Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate Update/delete for Dataadapter in code 1

Status
Not open for further replies.

PoppapumpJ

Programmer
Dec 17, 2001
86
US
Hey,

I have built a dataadapter in a class that returns a dataset. Now I would like to use that same code to make my updates with. Is there a method that will generare my update/delete/add statments at run time, similar to the wizard. I do supply a select string.

thanks



 
OleDbCommandBuilder

Example:
Code:
... ' Code that creates an Adapter named myAdapter
objBuilder = New OleDbCommandBuilder(myAdapter)
obj.Adapter.UpdateCommand = objBuilder.GetUpdateCommand()
obj.Adapter.InsertCommand = objBuilder.GetInsertCommand()
obj.Adapter.DeleteCommand = objBuilder.GetDeleteCommand()

Should do the trick for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top