Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OleDBDataAdapter.Update
Message
From
27/02/2005 16:32:05
 
 
To
27/02/2005 14:56:27
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00991026
Message ID:
00991037
Views:
15
Hey Grig,

You're mixing apples and oranges here. If you're going to use the Update() method, you don't specify the parameters. The Update() method will go through your Table and insert the records that are marked as Added. It will set up the parameters for you. My guess is that you don't have any rows to add ... either you've already done an AcceptChanges() on your DataTable, or you didn't insert a row into it.

~~Bonnie



>This is driving me crazy again.
>
>I have an OleDbDataAdapter. I've set it's Insert command and it looks like this:
>
>
>OleDbDataAdapter.InsertCommand.CommandText = "Insert into table (field1, field2) Values (@par1, @par2)"
>OleDbDataAdapter.InsertCommand.Parameters.Add("@par1","value1")
>OleDbDataAdapter.InsertCommand.Parameters.Add("@par2","value2")
>OleDbDataAdapter.Update(dsTable)
>
>
>It doesn't insert the row and it doesn't raise any error. How to overcome this? what I am doing wrong? I've already wasted half of a day and I can't afford any time waste anymore. If there is a better way to do this, please help me.
>
>Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform