Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error trying to save changed web data
Message
De
09/04/2004 10:23:12
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00893053
Message ID:
00893540
Vues:
14
Hi, Richard-

>The line the error occurs on is
>UpdateResult = oledbDA.Update(oledbDS, "Contacts")

*snipped*

>        ' Create the UpdateCommand.
>        oledbCMD = New OleDbCommand("UPDATE Contacts SET Company= MyCompany
>WHERE Unique_ID = MyContacts_Unique_ID", oledbConn)
>        oledbCMD.Parameters.Add("@Company", OleDbType.Char, 50, "Company")
>        oledbCMD.Parameters.Add("@Contact", OleDbType.VarChar, 50, "Contact")
>        oledbDA.UpdateCommand = oledbCMD
>
>        oledbDS = New DataSet
>        oledbDA.Fill(oledbDS, "Contacts")
>                UpdateResult = oledbDA.Update(oledbDS, "Contacts")

*snipped*
Maybe I haven't had enough coffee yet this morning, but if you're using parameters, I'd expect your command text to look like
..."UPDATE Contacts SET Company=? WHERE Unique_ID = ?"
Also, point of curiousity, why do you use OleDbType.Char for Company but OleDbType.VarChar for Contact?

Lastly, I'd urge you to simplify, and write a very simple sample program that just get's the updating command correct before you try to add it into a larger module. Just a suggestion.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform