Z
Zuy Tran
I'm trying to update my data source using the Update method in
OleDbDataAdapter with automatic command generation and I got error "Dynamic
SQL generation for the UpdateCommand is not supported against a
SelectCommand that does not return any key column information.". Does any
one know what I am missing? My codes look like this:
' Where the connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="C:\myDataFile.mdb;Mode=ReadWrite|Share Deny None"
mDBAdapter = new OleDbDataAdapter ()
mDBAdapter.SelectCommand = New OleDbCommand ("Select Id, Pacakge from
_mPackage Where Obsolete=0 Order By Package", mDBConn)
mDBCmdBuilder = new OleDbCommandBuilder (mDBAdapter)
mDBDataSet = new DataSet()
mDBConn.Open
mDBAdapter.Fill (mDBDataSet, "_mPackage")
Try
Din nRow as Integer = mDBAdapter.Update (mDBDataSet, "_mPackage")
Catch oEx as System.Exception
MessageBox.Show (oEx.Message)
End Try
mDBConn.Close
Thanks for your help
OleDbDataAdapter with automatic command generation and I got error "Dynamic
SQL generation for the UpdateCommand is not supported against a
SelectCommand that does not return any key column information.". Does any
one know what I am missing? My codes look like this:
' Where the connection string is "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="C:\myDataFile.mdb;Mode=ReadWrite|Share Deny None"
mDBAdapter = new OleDbDataAdapter ()
mDBAdapter.SelectCommand = New OleDbCommand ("Select Id, Pacakge from
_mPackage Where Obsolete=0 Order By Package", mDBConn)
mDBCmdBuilder = new OleDbCommandBuilder (mDBAdapter)
mDBDataSet = new DataSet()
mDBConn.Open
mDBAdapter.Fill (mDBDataSet, "_mPackage")
Try
Din nRow as Integer = mDBAdapter.Update (mDBDataSet, "_mPackage")
Catch oEx as System.Exception
MessageBox.Show (oEx.Message)
End Try
mDBConn.Close
Thanks for your help