|hi every body!
I use Oracle and for connection management I use OLEDB, the problem is where I want to do Update. the Update command is generated by an OleDBDataAdapter as the code below:
Public Sub UpdateData(ByVal oiDataSet As DataSet, ByVal siSQL As String, Optional ByVal siTableName As String = Nothing)
Dim oDataAdapter As New OleDbDataAdapter
If mbPiDisposed = True Then
Throw New ObjectDisposedException(msPiModuleName, "This object has already been disposed. You cannot reuse it.")
oDataAdapter.SelectCommand = New OleDbCommand(siSQL, mcnPiConnection, mtrPiTransaction)
Dim oCommandBuilder As OleDbCommandBuilder = New OleDbCommandBuilder(oDataAdapter)
If siTableName = Nothing Then
Catch ex As Exception
Throw New Exception(msPiExceptionMessage, ex)
when I call this Sub (I pass a simple "SELECT * FROM TABLE_NAME" and Updated data as "oiDataSet" to the OleDBDataAdapter as shown above) this error is shown: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information"
I searched the Internet But every one said that you may have not define a primary key, but my table has one!!
I should say the INSERT commands are OK, the problem is with UPDATE and DELETE commands.
every suggestion would be appreciated