help me!!!!
-
This is my code: this.oracleConnection1.ConnectionString = "user id=HMS;data source=HMS2005;password=HMS"; da = new System.Data.OracleClient.OracleDataAdapter(); cmd = new System.Data.OracleClient.OracleCommand("select A1,A2 from TEST",oracleConnection1); da.SelectCommand = cmd; cb = new System.Data.OracleClient.OracleCommandBuilder(da); daset =new DataSet(); da.Fill(daset); daset.Tables[0].Rows[0][0]= "123"; da.Update(daset); So When My program was run . it throw one error and error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." Help me!!!!!!!!!!:doh:
-
This is my code: this.oracleConnection1.ConnectionString = "user id=HMS;data source=HMS2005;password=HMS"; da = new System.Data.OracleClient.OracleDataAdapter(); cmd = new System.Data.OracleClient.OracleCommand("select A1,A2 from TEST",oracleConnection1); da.SelectCommand = cmd; cb = new System.Data.OracleClient.OracleCommandBuilder(da); daset =new DataSet(); da.Fill(daset); daset.Tables[0].Rows[0][0]= "123"; da.Update(daset); So When My program was run . it throw one error and error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." Help me!!!!!!!!!!:doh:
You need to add the primary key colums in to the SELECT statement in order for the command builder to generate an UPDATE statement. If you don't do that then it won't know what row to UPDATE.
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More