such as the how to make the ReceiveMessage this variable is written in a string of code, but can not change the input to the stored in the database
CodePudding user response:
Using mediumtext field type And then if the string contains double quotation marks when the incoming, single quotes, remember to escape
CodePudding user response:
Incoming content not sure you take this first try
string ReceiveMessage=UPDATE ` brigade big 16-3 ` SET bar SET to complete the sign up='inspection declaration in the WHERE one pipe size=' DO - LDB01-35254-02 'AND line number=' 2 \ "- DO - 35254 - A2BZ - HT05 'AND joint number=' FW - 5 '
AND see how can successfully
CodePudding user response:
was not solved, feeling why you didn't go to think of the problem, then solve the problem of corresponding, I directly to you String ReceiveMessage="UPDATE ` brigade big 16-3 ` SET bar SET to complete the sign up=', 'WHERE single pipe inspection central=' DO - LDB01-35068-02 'AND joint number=" FW - 10' AND line number="' - DO - 35068 - A2BZ - HT35 '"; String ReceiveMessagecom1="INSERT INTO history (time, operation) VALUES ('" + DateTime. Now. ToLocalTime (), ToString () + "', '" + ReceiveMessage +") ";
Using splicing SQL string, the need to deal with special characters, special characters and you here, is' If you don't want to deal with special characters, it must use the parameter SqlParameter String ReceiveMessage="UPDATE ` brigade big 16-3 ` SET bar SET to complete the sign up='inspection declaration in the WHERE one pipe size=' DO - LDB01-35068-02 'AND joint number=' FW - 10 AND line number='- DO - 35068 - A2BZ HT35 -'"; String ReceiveMessagecom1="INSERT INTO history (time, operation) VALUES (@ CTime, @ ReceiveMessage)"; List Param=new List () { New SqlParameter (" @ CTime, "DateTime. Now), New SqlParameter (" @ ReceiveMessage, "ReceiveMessage); }; //or MySqlCommand CMD; CMD. The Parameters. AddWithValue (" @ CTime, "DateTime. Now);
CodePudding user response:
Don't think, even if you resolve this time, next time meet this problem or not