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

C#Á¬½ÓMySQL½øÐвÙ×÷µÄ·½·¨

ÓÉÓÚÐèҪʵÏÖÒÔϹ¦ÄÜ£º
Íø¹ØÍ¨¹ý´®¿Ú·¢ËÍÊý¾Ý¸øPC»ú£¬PC»úÊÕ¼¯Êý¾Ý²¢½âÎö±£´æµ½MySQLÖУ¬È»ºóJSPÒ³Ãæ¶ÁÈ¡MySQLÖеÄÊý¾Ý²¢ÏÔʾ¡£
ËùÒÔÀûÓÃC#Á¬½ÓMySQLÊý¾Ý³ÉΪÁ˱ØÐëÒª¾­¹ýµÄ¹ý³Ì£¬Ôڴ˸øÓèÏêϸµÄ˵Ã÷¡£
1¡¢ÏÂÔØÐèÒªµÄÎļþMySQLDriverCS£¬ÏÂÔØµØÖ·Îª£ºhttp://sourceforge.net/projects/mysqldrivercs
2¡¢°²×°Îļþ£ºMySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exe£¬ÔÚ°²×°¹ý³ÌÖÐÒ²Ðí»áÌáʾһ¸ö´íÎ󣬽ûֹдһ¸ödllÎļþ£¬ÄãÖ±½ÓºöÂԾͿÉÒÔÁË¡£
3¡¢½«°²×°ÎļþϵÄMySQLDriver.dllÎļþÌí¼Óµ½C#ÏîÄ¿µÄÒýÓÃÖС£
4¡¢È»ºóд¹«¹²´¦ÀíÀàÈçÏ£º
(1) Ê×ÏȵÃÒýÓÃÃüÃû¿Õ¼ä£º
using MySQLDriverCS;
using System.Data;
using System.Data.Odbc;
(2) д¹«¹²´¦ÀíÀà
public class SQLHelper
{
MySQLConnection conn = null;
MySQLCommand commn = null;

public MySQLConnection GetConnect()
{
conn = new MySQLConnection(new MySQLConnectionString("localhost", "wwater", "root", "123").AsString);
return conn;
}
public int RunMySQL(string sql)
{
int count = 0;
try
{
conn = GetConnect();
conn.Open();
commn = new MySQLCommand(sql, conn);
count = commn.ExecuteNonQuery();
return count;
}
catch (Exception ex)
{
throw;
}
finally
{
conn.Close();
}
}
}
(3) ÔÚʵ¼Ê¹ý³ÌÖнøÐÐÒýÓÃRunMySQL·½·¨¼´¿É²åÈëÊý¾ÝÁË¡£  


Ïà¹ØÎĵµ£º

DelphiÓëC#Ö®¸¸£º¼¼ÊõÀíÏë¼Ü¹¹¿ª·¢´«Ææ

    Anders Hejlsberg(°²µÂ˹-º£É­²©¸ñ) ×øÔÚ×Ô¼ºµÄ°ì¹«ÊÒ£¬Ë«ÑÛÖ±Ö±µÄ¶¢×Åǰ·½¡£ËûÒª×öÒ»¸ö¾ö¶¨£¬¾ö¶¨×Ô¼ºÎ´À´µÄÃüÔ˺ÍÀíÏë¡£ÕâÊÇ1996ÄêÒ»¸öÆÕͨµÄÏÂÎ磬¼¸¸öСʱǰ£¬Ëû¸ÕÓë±È¶û-¸Ç´Ä½áÊøÁËÒ»´ÎÓä¿ìµÄÎç²Í£¬Í¬ÎªÈí¼þ½çµÄ¾«Ó¢£¬ËûÃÇÏà̸Éõ»¶£¬¸Ç´Ä¸øËû¿ª³öÈý°ÙÍòÒÔÉϵÄÄêнºÍÊýÍò¹ÉµÄ΢Èí¹ÉƱ¡£ÕâÊÇÒ»¸öÓÕÈË ......

C#´¦Àíoracle lobµÄÀý×Ó

  protected void BindData1()
    {
        OracleConnection orcn = new OracleConnection("User ID=wesoftwcp; Password=wesoft; Data Source=oradb");
        orcn.Open();
      &nb ......

mysqlÊý¾Ý¿â·¶Ê½Ïê½â

ÔÚÉè¼Æ¹ØÏµÊý¾Ý¿âʱÊÇÒª×ñÊØÒ»¶¨µÄ¹æÔòµÄ¡£ÓÈÆäÊÇÊý¾Ý¿âÉè¼Æ·¶Ê½ÏÖ¼òµ¥½éÉÜ1NF£¨µÚÒ»·¶Ê½£©£¬2NF£¨µÚ¶þ·¶Ê½£©£¬3NF£¨µÚÈý·¶Ê½£©ºÍBCNF£¬ÁíÓеÚËÄ·¶Ê½ºÍµÚÎ巶ʽÁôµ½ÒÔºóÔÙ½éÉÜ¡£ÔÚÄãÉè¼ÆÊý¾Ý¿â֮ʱ£¬ÈôÄÜ·ûºÏÕ⼸¸ö·¶Ê½£¬Äã¾ÍÊÇÊý¾Ý¿âÉè¼ÆµÄ¸ßÊÖ¡£
µÚÒ»·¶Ê½£¨1NF£©£ºÔÚ¹ØÏµÄ£Ê½RÖеÄÿһ¸ö¾ßÌå¹ØÏµrÖУ¬Èç¹ûÿ¸öÊôÐÔÖµ¶¼Ê ......

MySQLÓëÊÂÎñ


MySQL5.X¶¼ÒѾ­·¢²¼ºÃ¾ÃÁË£¬µ«ÊÇ»¹ÓкܶàÈËÈÏΪMySQLÊDz»Ö§³ÖÊÂÎñ´¦ÀíµÄ£¬Õâ²»µÃ²»¹ÖËûÃÇÊǹª¹ÑÎŵ쬯äʵ£¬Ö»ÒªÄãµÄMySQL°æ±¾
Ö§³ÖBDB»òInnoDB±íÀàÐÍ£¬ÄÇôÄãµÄMySQL¾Í¾ßÓÐÊÂÎñ´¦ÀíµÄÄÜÁ¦¡£ÕâÀïÃæ£¬ÓÖÒÔInnoDB±íÀàÐÍÓõÄ×î¶à£¬ËäÈ»ºóÀ´·¢ÉúÁËÖîÈçOracleÊÕ
¹ºInnoDBµÈÁîMySQL²»Ë¬µÄÊÂÇ飬µ«ÄÇЩÉÌÒµÉϵĶ·ÕùÓë¼¼ÊõÎÞ¹ ......

ÓÃpythonÁ¬½ÓmysqlÊý¾Ý¿â


#
-*- encoding: gb2312 -*-
import
os, sys, string
import
MySQLdb
#
Á¬½ÓÊý¾Ý¿â
try
:
conn
=
MySQLdb.connect(host
=
'
localhost
'
,user
=
'
root
'
,passwd
=
'
xxxx
'
,db
=
'
test1
'
)
except
Exception, e:
print
e
sys.exit()
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ