C# Á¬½ÓMySqlµÄ·½·¨
1.´Óhttp://prdownloads.sourceforge.net/mysqldrivercs/MySQLDriverCS-n-EasyQueryTools-3.0.18.exe?downloadÉÏÏÂÔØMySQLDriverCS.
2.°ÑMySQLDriverCS.dll.Ìí¼Óµ½.netµÄ×é¼þ
3.ʹÓ÷½·¨
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
ÏÂÃæÊÇ´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó:
using MySQLDriverCS;
MySQLConnection conn = new MySQLConnection( new MySQLConnectionString("localhost","test","root","").AsString );
conn.Open();
Èç¹ûÄãʹÓõÄÊÇ.netµÄ¼¯³É¿ª·¢»·¾³(visual studio.net)ÄÇôÔÚ´úÂëÖÐÊäÈëMySQLDriverCSºóÔÙÊäÈëÒ»¸ö”.”¾Í¿ÉÒÔ¿´µ½MySQLDriverCSÃû³Æ¿Õ¼äÖеÄËùÓеĶ«Î÷ÁË.
ÏÂÃæÊÇcommond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
cmd = new MySQLDriverCS.MySQLCommand("CREATE TABLE test.mysqldrivercs_test("+
"SettingID tinyint(3) unsigned NOT NULL auto_increment,"+
"SettingValue text, "+
"PRIMARY KEY (SettingID), UNIQUE KEY SettingID(SettingID), KEY SettingID_2 (SettingID))"+
" TYPE=MyISAM COMMENT='MySQL test table'",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
ÏÂÃæÊÇinsert:
·½·¨ÔÐÍ£º
public MySQLInsertCommand(
MySQLConnection conn,
object[,] FieldsAndValues,
string Table
);
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"field1",SettingID},{"field2",Value}},
"mysqldrivercs_test"
);
mysqldrivercs_test ÊDZíÃû
ÏÂÃæÊÇupd
Ïà¹ØÎĵµ£º
È¡µÃÎÄÕ¹ؼü×ÖΪkeywords
±ínewsµÄ¹Ø¼ü×Ö×Ö¶ÎΪkeyword
keywords=keywords.replace(',','|');
String sql="SELECT * from news WHERE keyword REGEXP '"+keywords+"' ORDER BY id ";
ÓÉÓÚijЩÔÒò£¬ÓÐʱºòÎÒÃÇûÓа´ÕÕ·¶Ê½µÄÉè¼Æ×¼Ôò¶ø°ÑһЩÊôÐԷŵ½Í¬Ò»¸ö×Ö·û´®×Ö¶ÎÖС£±ÈÈç¸öÈËÐËȤ£¬ÓÐʱºòÎÒÃÇÉè¼Æ±íΪ
cr ......
<HTML><HEAD><TITLE>WMI Scripting HTML</TITLE>
<META http-equiv=Content-Type c>
<SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo>
var MACaddress=unescape(MACAddr);
alert(MACaddress);
document.forms[0].txtMACAddr.value=u ......
1¡¢´´½¨mysqlÊý¾Ý¿âµÄ¹ÜÀíÓû§
Êý¾Ý¿â°²×°ºÃºó£¬ÎÒÃÇÓ¦¸ÃΪmysqlÊý¾Ý¿â´´½¨Ò»¸ö¹ÜÀíÕʺš£Òª°ÑrootÓû§ÉèÖÃΪ¹ÜÀíÔ±£¬´ËʱÐèÒªÖ´ÐÐÏÂÃæÃüÁ
[root@CDS2 bin]# /usr/bin/mysqladmin -u root password 123456
˵Ã÷£ºÉÏÃæ´´½¨µÄmysqlÊý¾Ý¿â¹ÜÀíԱΪroot£¬ÃÜÂë123456
2¡¢´´½¨Ò»°ãµÄÓû§
¹¤×÷ÖÐÓõ½web·þÎñÆ÷ºÍmysql·þÎñÆ ......
1.ÔÚORACLEÖÐÓÃselect * from all_usersÏÔʾËùÓеÄÓû§£¬¶øÔÚMYSQLÖÐÏÔʾËùÓÐÊý¾Ý¿âµÄÃüÁîÊÇshow
databases¡£¶ÔÓÚÎÒµÄÀí½â£¬ORACLEÏîÄ¿À´ËµÒ»¸öÏîÄ¿¾ÍÓ¦¸ÃÓÐÒ»¸öÓû§ºÍÆä¶ÔÓ¦µÄ±í¿Õ¼ä£¬¶øMYSQLÏîÄ¿ÖÐÒ²Ó¦¸ÃÓиöÓû§ºÍÒ»¸ö¿â¡£ÔÚ
ORACLE(db2Ò²Ò»Ñù)Öбí¿Õ¼äÊÇÎļþϵͳÖеÄÎïÀíÈÝÆ÷µÄÂß¼±íʾ£¬ÊÓͼ¡¢´¥·¢Æ÷ºÍ´æ´¢¹ý³ÌÒ²¿É ......
×÷Õß: ÍõÕßÖ®½£(http://www.albertsong.com/) ÈÕÆÚ: 2008-01-05 22:10
×ÖÌå´óС: С ÖÐ ´ó
ʾÀýÑÝʾÁËÓÃC#²Ù×÷MySQLµÄ·½·¨£¬ÌṩÁËÈý¸ö¿ÉÖØÓõÄÀàMySqlDBUtil,MySqlPageUtil,Page¡£
±¾Ê¾ÀýÓÉ C#²Ù×÷AccessÊý¾Ý¿âµÄ¼òµ¥Àý×Ó£¨http://www.albertsong.com/read-56.html£©Ð޸ĶøÀ´¡£
1.Ê×ÏÈÏÂÔ ......