another weird problem...please help!
I have already used this code in my other form and it works perfectly well...when I used the same code to update another table from another from...i get this error:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
I can't figure this one out myself anymore. Hope you experts here could help me again. Many thanks!
here's my code anyway...(my dataset, connection and dataadapter were created through the wizard)
Dim dr As DataRow
Dim strSQL As String
Dim cbuild As System.Data.OleDb.OleDbCommandBuilder
cn1.Open()
dr = DsProd1.Tables("ProductList").NewRow
dr("ProductID") = txtProdID.Text
dr("ProductDescription") = txtProdName.Text
dr("Product Type") = txtProdType.Text
dr("Dimensions") = txtProdDimen.Text
dr("Price") = txtProdSRP.Text
Me.BindingContext(DsProd1, "ProductList").EndCurrentEdit()
strSQL = "Select * from ProductList"
daProd1 = New System.Data.OleDb.OleDbDataAdapter(strSQL, cn1)
cbuild = New System.Data.OleDb.OleDbCommandBuilder(daProd1)
daProd1.UpdateCommand = cbuild.GetUpdateCommand
daProd1.Update(DsProd1, "ProductList")
DsProd1.AcceptChanges()
daProd1.UpdateCommand.Connection.Close()
MsgBox("Record has been updated.", MsgBoxStyle.OKOnly)
End Sub