Link to home
Start Free TrialLog in
Avatar of james_daley
james_daley

asked on

Add Data to Database using VB.NET

I'm creating a small application using VB.NET whereby i've bound some comboboxes to a database containing data, however now i wish to do the reverse and use some textboxes and other controls to write back to the database. Can anyone give me details on how this can be done, given i've already made a connection to the database? Can this be done simply (like binding) or do i need code?

Thanks
Avatar of james_daley
james_daley

ASKER

Figured it out, once i got my head around Datasets, TableAdapters, etc  it became quite easy. Given i'v already made a connection with the database (as my comboboxes are bound to tables) i just need to access the relevant Tableadapter to make the change.

ie. The Table called "Holidays" has  a TableAdapter called "HolidaysTableAdapter" and my Dataset is called "Leave_DataSet". Therefore:
       
      Dim DA As New Leave_DatabaseDataSetTableAdapters.HolidaysTableAdapter

      DA.Insert("Value for Column1, Value for Column2,etc......")
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial