Public Function UpdateDemo(myDataSet As DataSet, myConnection As String, mySelectQuery As String, myTableName As String) As DataSet
    Dim myConn As New OleDbConnection(myConnection)
    Dim myDataAdapter As New OleDbDataAdapter()
    myDataAdapter.SelectCommand = New OleDbCommand(mySelectQuery, myConn)
    Dim custCB As OleDbCommandBuilder = New OleDbCommandBuilder(myDataAdapter)
 
    myConn.Open()
 
    Dim custDS As DataSet = New DataSet
    myDataAdapter.Fill(custDS)
 
    ' The userr code for modifying the DataSet 
 
    ' OleDbCommandBuilder generates the update and insert command  and        
    'this operation will fail without this
    myDataAdapter.Update(custDS)
 
    myConn.Close()
 
    CreateCmdsAndUpdate = custDS
End Function 'SelectOleDbSrvRows