Visual Basic.net, I need help, data source and dataset updating using a data grid with a standard .exe

I am new to vb.net.  can someone please tell me how I can update a data set with changes I make to a dataGrid.  or if I need to code each individual change.  I am writing a standard windows application.  and I need to change the MS Access database using my program.  I have been able to read it fine... it is just the writing that is the problem.  the MSDN help on the subject has sent me in circles.  and I just want a simple explanation of what to do.  PLEASE HELP!


Answer this question

Visual Basic.net, I need help, data source and dataset updating using a data grid with a standard .exe

  • OneStrayCat

    Generate the needed commands by using the jet provider's OLEDBDataAdapter against the Access database. Define your select query and then access the advanced options in order to have the adapter generate the update and delete commands. Then in your code execute the commands as normal by adding typed parameters, etc., and calling the appropriate procedure. finish up by invoking the <dataset.acceptChanges()> method. Now refresh your datagrid and all should be gravy baby.
  • Stevehat

    Hi Larry,
    To get a feel for a round trip experience you can use the Data Sources Window to create a connection to your database.  Choose the table you wish to edit.  Then drag the table from the Data Sources Window to your form.  Once you drop the table on the form VS will generate the code to load and save your form.
    For more info, please checkout the docs, or our team blog @ http://blogs.msdn.com/vbteam/archive/category/4754.aspx
    Steve Lasker
    Program Manager
    Visual Studio Data Designtime

  • Visual Basic.net, I need help, data source and dataset updating using a data grid with a standard .exe