dpifer Posted July 23, 2003 Posted July 23, 2003 Good Evening All, I just recently have been fooling around with VB.NET and ADO.NET. I am a big fan of writing my own code instead of using wizards to do the work for me and I have not been able to update a database yet. By using the wizards I have been able to do this but have yet to be successful doing it through code using a data adapter. If someone could look at the attached file and see if I am way off course or just a minor glitch in my logic somewhere. I used the SQL Server Northwind database for a sample. Thanks, Dave Piferupdateadapter.zip Quote
karimgarza Posted July 23, 2003 Posted July 23, 2003 Solution and file included the problem with your code is that you were using two dataadapters: one for the select statement and another for the insert. you need to have one dataadapter for all the operations (delete, insert, add, update) Also you needed to correct the insert command and specify the insert values as parameters. you can see the changes and the comments I left in the code. Best of luckupdateadapter.zip Quote You're either a one or a zero. Alive or dead.
dpifer Posted July 24, 2003 Author Posted July 24, 2003 I see where my errors were...works like a charm now. Thanks alot....I really appreciate it!!! Dave Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.