Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert generates NULL error
Message
De
05/12/2006 12:24:46
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01174759
Message ID:
01174973
Vues:
7
Joel this work fine with insertcommand and updatecommand as long you open the connection prior to using the dataadapter, remember that the dataadapter will open and close the the connection in case it wasn't open at prior.
Now this will work for fields missing on the insert/update command, will not work if you put a null value on that field, or fiel.ds that you didn't set the value.
What I do in that case is that I have a method that goes over each row and col and sets default values or blank ones in case no default value exist.


>Alex,
>
>Does this work for commands that become InsertCommands or UpdateCommands? I can get the SET commands to stick when I just do straight SQL statements (like running an INSERT command directly through the CommandText of a SelectCommand).
>
>But when I fill a DataTable and then set the InsertCommand of the data adapter, NULL values trigger an error when the Update method tries to insert a new record...
>
>Do you use your Command objects with the Update method and have it work?
>
>Thanks,
>JoeK
Alexandre Palma
Senior Application Architect
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform