C#Á¬½ÓMYSQL£¬¶ÁÈ¡ÖÐÎÄÎÊÌâ
MySQLConnection DBConn; DBConn = new MySQLConnection(new MySQLConnectionString("localhost" , "admin" , "root" , "123456" , 3306).AsString); DBConn.Open(); MySQLCommand DBComm; DBComm = new MySQLCommand("select * from tb1" , DBConn); MySQLDataReader DBReader = DBComm.ExecuteReaderEx(); try { while (DBReader.Read()) { Console.WriteLine("Host = {0} and User = {1}", DBReader.GetString(0),DBReader.GetString(1)); //×¢£ºDBReader.GetString(0)ÔÚÊý¾Ý¿âÖдæµÄÊÇÖÐÎÄ£¬µ«²éѯ³öÀ´ÊÇ¡®ÂÒÂ롯 ÏÔʾµ½Ò³ÃæÊÇÈ«ÊÇ£¿ Ôõô½â¾öÕâÎÊÌ⣿Êý¾Ý¿â±àÂë¸ñʽûÎÊÌâ(gb2312) ±ð˵ÅäÖÃweb.config£¬ÊÔ¹ýÁË£¬²»¹ÜÓᣠҲ±ð˵±àÂë½âÂ룬¶¼²»¹ÜÓᣠ} } finally { DBReader.Close(); DBConn.Close(); } DBConn.Close();
û»Ø»Ø´ð£¿ Data Source=localhost;Port=3306;User ID=???;Password=????;Initial Catalog=?????;Pooling=true;Allow Zero Datetime=true;charset=gb2312 ÉÏÃæµÄÊÇconnectstring ÎÒ¿ñ¶¥Äã Ö±µ½ÎÊÌâ½â¾öΪֹ ÔÙ¶¥ ÎÒÍùËÀÀﶥÒýÓà Data Source=localhost;Port=3306;User ID=???;Password=????;Initial Catalog=?????;Pooling=true;Allow Zero Datetime=true;charset=gb2312 ÄãÒâ˼ÊÇDBConn = new MySQLConnection(new MySQLConnectionString("localhost" , "admin" , "root"
Ïà¹ØÎÊ´ð£º
±àÒëÆ÷£ºC-Free4 mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓᣠ×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£ Íü¸ßÊÖÖ¸µãÒ»¶ ......
ÎÒÊÇÓÃmysql×Ô´øµÄC API if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0)) { AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
Winform+MySQL×öÏîÄ¿£¬ÔÚ×¢ÖØÐÔÄܵÄÇé¿öÏ£¬ÎÒ¸ÃÈçºÎÈ¥Íê³ÉÕâÀàÐ͵ÄÏîÄ¿ÄØ£¡ Çë¸÷λ¸øÒÔÌáʾ¡£ ÄãÕâ¸ö·¶Î§Ì«¹ãÁË£¬ÎÒ˵2µãÖØÒªµÄ°É 1.WINFORM³ÌÐòÊǵ¥¶ÀÔËÐеÄCS³ÌÐò£¬ºÍBS²»Í¬£¬BSµÄѹÁ¦Ê¼ÖÕ¶¼ÔÚSERVERÉϵģ¬¶ÔC ......
MYSQL ½ØÈ¡Ò»¸öÊý¾Ý±íÖÐ,ijһ¸ö×Ö¶Î(fulltext) µÄÇ°Èý°Ù¸ö×Ö·û,·Åµ½¸Ã±íÏÂÁíÒ»¸ö×Ö¶Î(introtxt)Àï. ÇóʵÏÖÕâ¸öЧ¹ûµÄÃüÁî SQL code: update ±í set introtxt=left(`fulltext`,300); ¶¥£¬Ñ§Ï° SQL code: ......
¼ÙÈçÊý¾Ý¿âÖÐÓиötest±í£¬±íÖÐÓÐid£¬Name£¬num£¬¼Ç¼ʱ¼ä idΪ×ÔÔö³¤Ö÷¼ü£¬nameÊÇÃû×Ö£¬num±íʾÆäÊýÁ¿ 1 nike 100 ϵͳʱ¼ä 2 nike 300 &n ......