Okay first off I know I can use a command object to update the database but I'm looking to do something similar to this:
Dim DataRow1 As DataRow
Dim DataTable1 As New DataTable
Dim da_Clients As New SqlServerCe.SqlCeDataAdapter("Select * from tblClients", cn)
Dim myDataRowsCommandBuilder As SqlCeCommandBuilder = New SqlCeCommandBuilder(da_Clients)
da_Clients.MissingSchemaAction = MissingSchemaAction.AddWithKey
Dim ds_clients As New DataSet
da_Clients.Fill(ds_clients, "tblClients")
DataRow1 = ds_clients.Tables("tblClients").Rows.Find(strName)
DataRow1("State#") = Trim(txtStateID.Text)
DataRow1("SSN") = Trim(txtSSN.Text)
DataRow1("Birthdate") = Trim(txtBirthDate.Text)
DataRow1("Address") = Trim(txtAddress.Text)
DataRow1("Phone") = Trim(txtPhone.Text)
DataRow1("UCI#") = Trim(txtUCI.Text)
DataRow1("Agency") = Trim(txtAgency.Text)
'Tried this, still no go:
'ds_clients.Tables("tblClients").Rows(0)("Address") = "Testing"
da.Update(ds_clients, "tblClients")
It throws an error on the da.Update line simply saying "Update". Seriously, that is the ENTIRE DESCRIPTION. Just "Update". Basically i'm looking for something similar to recordset updating:
rstText.Open "query"
rstTest("Field1") = "Blah"
rstTest.Update
Here's the actual error:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.Common.dll
Additional information: Update




Reply With Quote