天天看点

解决.net连接mysql乱码

褰搈ysql鏁版嵁搴撲负GBK缂栧彿锛?net绋嬪簭浣跨敤榛樿缂栫爜锛圲TF-8锛夛紝鍚憁ysql涓彃鍏ユ暟鎹鏄撲骇鐢熶贡鐮併€傝В鍐冲姙娉曟槸鍦ㄨ繛鎺ュ瓧绗︿覆鍔犲叆Charset=gbk锛?

MySqlConnection myConnection = new MySqlConnection("Database=test2;Data Source=localhost;User Id=root;Password=ikmbikmb;Charset=gbk");