The documentation says that LoadDataRow updates or inserts based upon
whether the row exists or not. It does not say so in the documentation, but
I figured the only way for it to know that is for it to check the Primary
key. So, in my dataset, I defined a Primary key for the table, like this:
Dim keyColumn(1) As DataColumn
keyColumn(0) = ds.Tables(TableName).Columns(i)
ds.Tables(TableName).PrimaryKey = keyColumn
Now when I use the following:
drins = MyDataSet.Tables("Profiles").LoadDataRow(NewRow, True)
I get an error message saying "Column 'ProfileID' is constrained to be
unique. Value '2' is already present." In other words, it will not update,
only insert.
What gives?
TIA,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv