Add Data to Database using VB.NET

Posted on 2007-10-03
Last Modified: 2013-11-26
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?

Question by:james_daley
    LVL 1

    Author Comment

    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......")
    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now