Dim Con As OleDbConnection = New OleDbConnection(\"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Music_Sales_Database.mdb;\")
Dim Com As OleDbCommand
Dim Sale
You're making things more complex than they need to be. Just create a DataTable
and bind it to the grid. When it comes time to save the data, it takes one call to the Update
method of a data adapter to save the lot. You use the same data adapter to generate the schema in the DataTable
by calling FillSchema
and then use a command builder to generate the INSERT
command or you can build the schema and the INSERT
command manually. Here are some examples:
http://www.vbforums.com/showthread.php?469872-Retrieving-and-Saving-Data-in-Databases&highlight=