Well, I found the answer to my own question:
ds.Tables("tbl2").Load(reader, LoadOption.Upsert)
I have to include this optional argument:
LoadOption.Upsert
I was thinking that may have been a type like maybe the VS2005 team meant
Insert (maybe they did mean that), but maybe they meant Update/Insert.
Either way, if I add this argument to the Load Method, now the data transfers
all the way to the sql server no problem.
> Hello,
>
[quoted text clipped - 42 lines]
> Thanks,
> Rich
gfergo@gmail.com - 30 Mar 2007 17:44 GMT
Rich,
Although "upsert" sounds kinda funny, I believe it is what you need -
DataSet columns store an original and a current value. PreserveChanges
will keep the current value intact while overwriting the original
value. Upsert does the opposite of this as it keeps the original value
intact while overwriting the current value.
Here is an example of when PreserveChanges might come in handy.
Suppose a user named Peggy has opened a screen and loaded a DataGrid
with customers from a DataSet. Peggy modifies the city of the customer
with CustomerID ALFKI from Berlin to New York, but doesn't click the
Save button. She then goes off for a cup of coffee. Meanwhile,
Katherine modifies the same customer's city from Berlin to Miami.
You'll now have a data concurrency issue if Peggy comes back from her
break and saves the record. So in this situation, the original value
for Peggy's customer record was Berlin and since she changed it to New
York the current value is New York. Meanwhile, in the database the
city is now Miami. If you want to reset the original values of Peggy's
DataSet to what is in the database, you could get the data from the
database into a DataTableReader and then load it into the DataSet
using LoadOptions.PreserveChanges.
> Well, I found the answer to my own question:
>
[quoted text clipped - 57 lines]
>
> - Show quoted text -