wallaceoc80
Programmer
I have an ASP.NET web form using C# as my code behind language. I am working with an oracle database am having problems if I try to insert a new value into the database if it has letters such as apostrophe's in it. The code I'm using is below:
However, this doesn't deal with it! Any ideas what is wrong here?
Thanks for the help,
Wallace
Code:
string createMessageSQL = "insert into messages(title, author, body, board, thread, date_created) " + "values(@subject, '" + Session["user"] + "', @body, " + strBoardID + ", " + strThreadID + ", " + "sysdate)";
OleDbCommand cmdCreateMsg = new OleDbCommand(createMessageSQL, conn);
cmdCreateMsg.Parameters.Add("subject", Server.HtmlEncode(tbNewReplySubject.Text));
cmdCreateMsg.Parameters.Add("body", Server.HtmlEncode(tbNewReplyBody.Text));
However, this doesn't deal with it! Any ideas what is wrong here?
Thanks for the help,
Wallace