Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 DLLÎÊÌ⣬¶®µÄÀ´ÇÀ·ÖÁË

//C ½Ó¿Ú
extern "C"
{
  TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);  
}
//ÎÒÔÚC#ÖÐÉùÃ÷
//µ÷ÓÃC DLL Öеĺ¯Êý
[DllImport("OCRapi.dll&quo ......

C# Á¬½ÓSQLÊý¾Ý¿â³£ÓõÄÁ¬½Ó×Ö·û´®¸ÃÈçºÎд£¿

£¨1£©string ConnString = "server=localhost;integrated security=sspi;database=pubs;";   
£¨2£©string strConnection="user uid=sa;pwd=123456;Database=test;Server=test;Connect ......

MySqlÎÊÌâ

MySqlÖвåÈ뵱ǰʱ¼äµÄ¸ÃÔõôд°¡£¿
now()

SQL code:

sqlÀïÊÇ£º
getdate()

ÒýÓÃ
now()


ѧϰ

SQL code:
select now();

SQL code:
TODAY()
?

SQL code:
select now();
/* ......

MYSQL°²×°Ê§°Ü

ÎÒÒÔǰ°²×°ÁËÒ»´Î£¬ºóÀ´Ð¶ÔØÁË£¬ÏÖÔÚÔÙ°²×°µÄʱºò£¬Ìáʾ´íÎó£ºError 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it. 
¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ