Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert generates NULL error
Message
From
05/12/2006 12:24:46
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01174759
Message ID:
01174973
Views:
6
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform