In an asp.net script I have, written by Dayve, I get an error with the SQL Query. But the error doesn't show the query executed. So I need a way to display the query so i can see why it is giving an error.
strSQL = "INSERT INTO FORUM_IMAGES (I_LOC, I_DESC, I_MID, I_DATE, I_SIZE, I_HEIGHT, _
I_WIDTH, I_TYPE) VALUES ('" + UploadedFileName + "', '" + UploadedDesc + "', " + _
MemberID + ", #" + DateTime.Now + "#, " + IntFileSize + ", " + IntFileHeight + ", " + _
IntFileWidth + ", '" + FileType + "');";
conImages = new OdbcConnection(myConnString);
conImages.Open();
cmdImgIns = new OdbcCommand(strSQL, conImages);
cmdImgIns.ExecuteNonQuery();
The error was:
ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-4.1.16-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
So I need a way to display the contents of strSQL. I would usually use a Response.Write with vbscript, but am lost as to how to do this in .net. Using C# I think it is.