Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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,c++Á¬½Ómysql ÕÒ²»µ½Í·²¿Îļþ£¨ÐÂÊÖ£©

±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......

mysqlµÄÁ¬½Ó³¬Ê±Ê±¼äÔõôÉèÖà - VC/MFC / Êý¾Ý¿â

ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......

Winform+MySQL×öÏîÄ¿

Winform+MySQL×öÏîÄ¿£¬ÔÚ×¢ÖØÐÔÄܵÄÇé¿öÏ£¬ÎÒ¸ÃÈçºÎÈ¥Íê³ÉÕâÀàÐ͵ÄÏîÄ¿ÄØ£¡
Çë¸÷λ¸øÒÔÌáʾ¡£
ÄãÕâ¸ö·¶Î§Ì«¹ãÁË£¬ÎÒ˵2µãÖØÒªµÄ°É
1.WINFORM³ÌÐòÊǵ¥¶ÀÔËÐеÄCS³ÌÐò£¬ºÍBS²»Í¬£¬BSµÄѹÁ¦Ê¼ÖÕ¶¼ÔÚSERVERÉϵģ¬¶ÔC ......

MYSQL Êý¾Ý½ØÈ¡

MYSQL ½ØÈ¡Ò»¸öÊý¾Ý±íÖÐ,ijһ¸ö×Ö¶Î(fulltext) µÄÇ°Èý°Ù¸ö×Ö·û,·Åµ½¸Ã±íÏÂÁíÒ»¸ö×Ö¶Î(introtxt)Àï.
ÇóʵÏÖÕâ¸öЧ¹ûµÄÃüÁî
SQL code:
update ±í set introtxt=left(`fulltext`,300);

¶¥£¬Ñ§Ï°

SQL code: ......

mysql ¼òµ¥ÎÊÌâ

¼ÙÈçÊý¾Ý¿âÖÐÓиötest±í£¬±íÖÐÓÐid£¬Name£¬num£¬¼Ç¼ʱ¼ä
idΪ×ÔÔö³¤Ö÷¼ü£¬nameÊÇÃû×Ö£¬num±íʾÆäÊýÁ¿

1  nike  100        ϵͳʱ¼ä
2  nike  300  &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ