Connector/net 6.9.8
Select. Net/mono, no installation required.
Copy the corresponding version of MySql.Data.dll to the bin directory for use
http://dev.mysql.com/downloads/connector/net/
However, when using the MySQL like statement to retrieve Chinese, the data is always not retrieved during use. The original is required this is the character encoding.
using MySql.Data.MySqlClient;
stringquery =@"(SELECT * from TB where title like '% China% ')"; Mysqlconnection myconnection=NewMysqlconnection ("Server=192.168.168.2;port=3306;user id=uid;password=pwd;database=dba; Charset=utf8 "); Mysqlcommand mycommand=Newmysqlcommand (query, MyConnection); Myconnection.open (); Mysqldatareader MyDataReader=Mycommand.executereader (); while(Mydatareader.read () = =true) { stringName = mydatareader["name"]. ToString (),} mydatareader.close (); Myconnection.close ();
Be careful not to write Utf-8
If you are using a configuration file:
<add name="mysqlproductdb" connectionstring="server=192.168.100.104;d Atabase=productdb; Uid=root; Pwd=justzee;charset=utf8 "providername="MySql.Data.MySQLCLIENT "/ >
MySQL connector/net mysql like search for Chinese (C # and ASP. NET connection MySQL)