Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 Pifer

updateadapter.zip

Posted

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 luck

updateadapter.zip

You're either a one or a zero. Alive or dead.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...