Last post Aug 21, 2013 10:30 PM by flash22231
Aug 21, 2013 01:35 AM|flash22231|LINK
I have a MySQL statement which is supposed to insert 2 bits data type value into 2 columns in MySQL database
IsCurrent and IsArchived are the bits(1) data type
mySQL = "CREATE TEMPORARY TABLE IF NOT EXISTS outputtbPollID (PollID char(38));INSERT INTO outputtbPollID(PollID) VALUES(?PollID); INSERT INTO Poll (PollID, AddedDate, AddedBy, QuestionText, IsCurrent,IsArchived) VALUES(?PollID, '" + DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss") + "', '" + Session["UserID"] + "' , ?Question, b'1',b'0'); SELECT PollID FROM outputtbPollID;";
I have an error when this sql statement is executed..
It works fine in a query in MySQL workbench but not as i run it on my asp web application
Aug 21, 2013 03:04 AM|k.panchal|LINK
Have you debug your code? means do you pass values other than 0 or 1 or not. This can be the cause of the error. Please debug and look into.
Aug 21, 2013 10:30 PM|flash22231|LINK
It passes the value but the database states 'NULL' in both columns
The error occurs at
Guid idcat = (Guid)cmdCreate.ExecuteScalar();