03-06-2011 01:26 AM - edited 03-06-2011 01:27 AM
sqlQry = "DELETE FROM tblNotes WHERE " + "noteID = @noteid;"; sqlStatement.text = sqlQry; sqlStatement.parameters["@noteid"] = note.ID; sqlStatement.execute();
Can someone help me out with above.. its driving me crazy... i'm converting all my sql queries to use parameters and get this error:
03-06-2011 01:35 AM
im not seeing any errors from what you have wrote. its pretty strange. try doing unnamed parameters and see if that helps. so put like a question mark (?) where @noteid is and use the parameter notation instead. see if that changes anything. good luck!
03-06-2011 07:09 AM - edited 03-06-2011 08:29 AM
Edited: I wrote that the Adobe docs say to use :noteid instead of @noteid but was looking at only the example shown, not the full text. Full text says either one should work...
03-06-2011 08:34 AM
Your error doesn't show a line number or anything like that. Are you certain the error is coming from this code block and not another?
Perhaps you are reusing the sqlStatement in a later call to execute(), and that parameter is still set on it.
If you want to reuse a sqlStatement instance for an unrelated command, you should do sqlStatement.clearParameters() on it first.