2
Answers

Error "Update requires a valid InsertCommand"

repkin05

repkin05

20y
2.5k
1
I have dataRow as named dRow; I have dataSet as named dSet; I have dataAdapter as named adapter; I have set like that dRow = dSet.Tables[0].NewRow(); then I have set dRow like dRow["colName"] = "value"; and then I have wrote that dSet.Tables[0] .Rows.Add( dRow ); at last I write that adapter.Update( dSet , "tableName" ); But it gives tihs error "Update requires a valid InsertCommand when passed DataRow collection with new rows." But I have insert only one row. Why it gives this error and how can I fix it?
Answers (2)