Home > database > How to modify the insert statement in the sqlhelper
How to modify the insert statement in the sqlhelper
Time:09-26
Novice a, student information management system, the debugging tip: the column name or the number of values provided do not match with the table definition, Own SQLhelper couldn't find the database to add and delete statements, I ask where you can modify, their use is vs2010, thank everyone!
CodePudding user response:
Your helper SQL code directly out ah, At least post the complete code of the function,
Besides, SQL is written by yourself, close the SQL helper? General call should be similar to: String SQL="insert into the TAB (c1, c2) values (@ c1, @ c2)"; SqlParameter spArr=new SqlParameter [] [] { New SqlParameter (" @ c1 ", 21), New SqlParameter (" @ c2, 52) }; SqlHelper. ExecuteNonQuery (SQL, spArr);
Several parameters, with a few values, this problem does not match,
CodePudding user response:
Check the night information, a little understood, insert the code also found, But still thank you for your reply!