You can choose to use either option that you have listed. A little internet searching goes a long way to solve your problem.
http://www.google.com/search?hl=en&q=update+command+in+sql&aq=0&oq=Update+comm First item on the list: http://www.comptechdoc.org/independent/database/begin/sqlupdate.html http://www.google.com/search?hl=en&q=update+database+with+tableadapter First item on the list: http://msdn.microsoft.com/en-us/library/ms233819(VS.80).aspx http://www.google.com/search?hl=en&q=update+database+from+dataset&aq=0&oq=update+database+from First item on the list http://quickstart.developerfusion.co.uk/quickstart/howto/doc/adoplus/UpdateDataFromDB.aspx On Mar 16, 2:16 pm, new db dvlpr <aronb2...@gmail.com> wrote: > Hello all, > > I have a general question. I am trying to figure out how to do a > update from a visual basic 2005 to a SQL server 2005 database. > Currently, I have the application connecting and retrieving data from > the database. But I can't seem to figure out how to do an update. I > will explain what I am trying to do. As an example, a user searches > for a certain customer and then upon finding some info for that > customer, user wants to update / enter some new info about customer > by providing input into certain form controls (textboxes, comboboxes > etc). After user has finished entering the info and then clicks the > 'Save' button, those values should be passed back into the database > and from there to the actual database. > > I think this can be done through two similar ways. One way is to > create an Update query under the appropriate table adapter in designer > mode of the dataset and then in the vb form code, pass the appropriate > values to the query. However, I am not sure what this query in the > tableadapter should look like and how to pass the values to it. > > The other way to do this task I think is by declaring and setting the > appropriate sql connection string, the dataadapter, sql query as the > sql command text, the dataset in the form's vb code. > > One important thing to note is that I don't want to do this task > through a toolstrip and the automatically created save button on > there. I am using a regular vb button to initiate the event to update. > > Thanks in advance.