Home > Net >  Please comment c # inserted into the database??????? The problem of
Please comment c # inserted into the database??????? The problem of

Time:11-20

String commandStr="insert into allemail (EmailName," +
"Time," +
"Contents," +
"Number) values ('" + textBox6. Text + ", "+
"'" + textBox7. Text + ", "+
"'" + textBox8. Text + ", "+
"'" + textBox9. Text + ") ";
MySqlCommand CMD=new MySqlCommand (commandStr, conn);
CMD. ExecuteNonQuery ();

For now writing for special reason I installed database

Here can't tick, if box installed in all normal

EmailName this table in the database character is


Want to ask everybody bosses I inserted into the database data is not how to solve???????

In baidu to find for a long time
GBK Encoding. GetEncoding (" "). Get string (Encoding. The Default. GetBytes (STR))
This method doesn't work

CodePudding user response:

Database, application software, the user's system environment variables, coding to maintain consistent,

CodePudding user response:

Has nothing to do with the hook, generally use UTF8 encoding, you try to UTF8
  •  Tags:  
  • C#
  • Related