Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 636
  • Last Modified:

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
0
james_daley
Asked:
james_daley
1 Solution
 
james_daleyAuthor Commented:
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......")
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now