Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OleDBDataAdapter.Update
Message
De
27/02/2005 16:32:05
 
 
À
27/02/2005 14:56:27
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00991026
Message ID:
00991037
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform