SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.
-
n my C# program, I get the following error when trying to write to a table: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." i use this code : da = new OracleDataAdapter(command, con); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; comB = new OracleCommandBuilder(da); da.Fill(ds, "product"); ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] }; comB.GetUpdateCommand(); da.Update(ds, "product");
Sujit
-
n my C# program, I get the following error when trying to write to a table: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." i use this code : da = new OracleDataAdapter(command, con); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; comB = new OracleCommandBuilder(da); da.Fill(ds, "product"); ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] }; comB.GetUpdateCommand(); da.Update(ds, "product");
Sujit
Hi Sujit! Do you have a primary column defined in the Table? If not then defined it. You must have a primary key defined in your database tables to avoid this error. I hope this will help you. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
-
Hi Sujit! Do you have a primary column defined in the Table? If not then defined it. You must have a primary key defined in your database tables to avoid this error. I hope this will help you. Regards.
"Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)
Hi friend Basically i have have a product table which have one primary key item_id. i use this statement for fetching data in dataset ( select itemcode,.......... from table) then i make a primary key in dataset on itamcode.after updating all data in dataset. i use da.update(ds) then it generate error. Where i am wrong please suggest me thanks
Sujit