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

C#²Ù×÷MySQLÊý¾Ý¿âµÄ¼òµ¥Àý×Ó


×÷Õß: ÍõÕßÖ®½£(http://www.albertsong.com/)  ÈÕÆÚ: 2008-01-05 22:10
×ÖÌå´óС: Ð¡ ÖР´ó
ʾÀýÑÝʾÁËÓÃC#²Ù×÷MySQLµÄ·½·¨£¬ÌṩÁËÈý¸ö¿ÉÖØÓõÄÀàMySqlDBUtil,MySqlPageUtil,Page¡£
±¾Ê¾ÀýÓÉ C#²Ù×÷AccessÊý¾Ý¿âµÄ¼òµ¥Àý×Ó£¨http://www.albertsong.com/read-56.html£©Ð޸ĶøÀ´¡£
1.Ê×ÏÈÏÂÔØMySQLÊý¾Ý¿âµÄ.NETÇý¶¯
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.8.1-noinstall.zip/from/pick#mirrors
½«binĿ¼ÀïµÄMySql.Data.dllÎļþ¸´ÖƵ½¹¤³ÌĿ¼£¬²¢ÇÒ½«dllµÄÒýÓüÓÈëµ½ÏîÄ¿ÖУ¬ÕâÑù¾Í¿ÉÒÔͨ¹ýÏà¹ØµÄÀàÀ´²Ù×÷MySQLÊý¾Ý¿âÁË¡£
using MySql.Data.MySqlClient;
using System.Data;
Á¬½Ó×Ö·û´®£ºString connectionString = "server=127.0.0.1;user id=root; password=as; database=albertsong; pooling=false;charset=utf8";
Á¬½Ó×Ö·û´®Öи÷¸öÏîÄ¿µÄÒâ˼ÊǺÜÃ÷È·µÄ£¬ÐèҪעÒâµÄÊÇcharsetÓ¦¸ÃÉèÖóɺÍÊý¾Ý¿â±íµÄcharsetÒ»Ö£¬·ñÔò¿ÉÄܳöÏÖÖÐÎÄÂÒÂë¡£
È»ºó½«Õû¸öÏîÄ¿ÖеÄOleDbÓÃMySqlÌæ»»£¬ÕâÑù»ù±¾ÉϾͿÉÒÔÁË¡£²»Í¬µÄÊÇ´ø²ÎÊýµÄsqlÓï¾ä£¬
AccessÖÐÊÇ
string sql="insert into product(name,quantity,price,sale_date,checked_flag)values(?,?,?,?,?)";
parameters[0]=new MySqlParameter("@name",MySqlDbType.VarChar,100);
MySqlÖÐÓ¦¸ÄΪ
string sql="insert into product(name,quantity,price,sale_date,checked_flag)values(?name,?quantity,?price,?sale_date,?checked_flag)";
parameters[0]=new MySqlParameter("?name",MySqlDbType.VarChar,100);
2.È¡µÃMySQL×ÔÔö±êʶ×Ö¶ÎÔÚ²åÈëÊý¾ÝºóµÄidÖµ
cmd.CommandText = @"select @@identity";
int value = Int32.Parse(cmd.ExecuteScalar().ToString());
return value;
ÓÃcmd.CommandText = @"select LAST_INSERT_ID()";½á¹ûÒ»Ñù£¬Á½ÕßµÄÇø±ðûÓÐÑо¿¡£
3.·ÖÒ³²éѯ
ʹÓÃLimit×Ó¾äÀ´´¦Àí·ÖÒ³²éѯ£¬ÕâÑùÏà¶ÔÓÚAccessµÄ·ÖÒ³²éѯ£¬´úÂë´óÁ¿¼ò»¯£¬Ð§ÂÊÒ²»áÌá¸ß¡£
´úÂëÕâÀïÏÂÔØMySqlDBUtilDemo.rar (198.41 KB , ÏÂÔØ:2598´Î)
±¾Àý³ÌÊÇÒ»¸öc#µÄwinform³ÌÐò£¬µ«ÊÇÊý¾Ý·ÃÎÊÀà¿ÉÒÔÔÚWeb»·¾³ÏÂʹÓá£
ÔËÐÐÇ°ÏÈÀûÓÃbin\ReleaseϵÄsqlÓï¾äÎļþ½¨±í²¢ÐÞ¸ÄMySqlDBUtilÖеÄÁ¬½Ó×Ö·û´®¡£
±¾Àý³ÌÑÝʾÁË£º
1.MySQLÊý¾Ý¿âµÄ²åÈ룬¸üУ¬Ð޸ģ¬²éѯ£»
2.´ø²ÎÊýµÄsqlÓï¾äµÄʹÓ㬶ø²»ÊÇÆ´SQL£»
3.ʹÓÃLimit×Ó¾äµÄ·ÖÒ³²éѯ£»


Ïà¹ØÎĵµ£º

Mysql whileÑ­»·Óï¾äÉú³É²âÊÔÊý¾Ý

ʹÓÃwhileÑ­»·Óï¾äÉú³É²âÊÔÊý¾Ý£º
ÏÂÃæµÄ·½·¨ÊÇͨ¹ý´´½¨Ò»¸ö´æ´¢¹ý³Ì£¬È»ºóÔÙµ÷ÓÃÕâ¸ö´æ´¢¹ý³ÌÀ´ÊµÏֵģ¬´ÓÍøÉÏÕÒÁ˺ܶ෽·¨£¬µ«¶¼Ã»Óгɹ¦¡£
delimiter // /*¶¨ÒåÃüÁî½áÊø·ûĬÈÏΪ ; */
create procedure genUsers()
begin
declare i int default 0;
while i < 40 do
insert into users(userID,userName, ......

C# asp.net macaddr

<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 ......

MYSQLÊý¾Ý¿âʵÓÃѧϰ×ÊÁÏÖ®³£ÓÃÃüÁºÏ


MysqlÊý¾Ý¿âÊÇÒ»¸ö¶àÓû§£¬¶àÏ̵߳ĹØϵÐÍÊý¾Ý¿â£¬ÊÇÒ»¸ö¿Í»§»ú/·þÎñÆ÷½á¹¹µÄÓ¦ÓóÌÐò¡£ËüÊǶԸöÈËÓû§ºÍÉÌÒµÓû§ÊÇÃâ·ÑµÄ.
¡¡¡¡MysqlÊý¾Ý¿â¾ßÓÐÒÔÏÂÓŵ㣺
¡¡¡¡1.ͬʱ·ÃÎÊÊý¾Ý¿âµÄÓû§µÄÊýÁ¿²»ÊÜÏÞÖÆ
¡¡¡¡2.¿ÉÒÔ±£´æ³¬¹ý5ǧÍòÌõµÄ¼Ç¼
¡¡¡¡3.ÊÇÄ¿Ç°Êг¡ÉÏÏÖÓÐÊý¾Ý¿â²úÆ·ÖÐÔËÐÐËÙ¶È×î¿ìµÄÊý¾Ý¿âϵͳ
¡¡¡¡4.Óû§È¨ÏÞ ......

MySQL°²×°ºÍÅäÖÃ

    ×î½üµÄÏîÄ¿ÖÐʹÓÃÁËMySQLÊý¾Ý¿â£¬Ò»Ð©MySQLµÄÐÂÓû§ÔÚÅäÖÃʹÓÃʱ»¹ÓÐЩ²»¹»ÊìÁ·£¬ÌØÔڴ˼Ǽ£¬·½±ã¿ª·¢ÍŶÓʹÓ㬸ÃÎÄÕÂËùÉæ¼°ÄÚÈݾù¿ÉÒÔÔÚMySQL²Î¿¼ÊÖ²áµÚ¶þÕ“°²×°MySQL”ÖÐÕÒµ½¡£MySQL°²×°ºó×Ô´øÁËÓ¢ÎIJο¼ÊֲᣬҲ¿ÉÒÔÔÚhttp://dev.mysql.com/doc/refman/5.1/zh/index.html²é¿´ÖÐÎÄ°æ±¾£ ......

ORACLE Óë mysql µÄÇø±ð

1.ÔÚORACLEÖÐÓÃselect * from all_usersÏÔʾËùÓеÄÓû§£¬¶øÔÚMYSQLÖÐÏÔʾËùÓÐÊý¾Ý¿âµÄÃüÁîÊÇshow
databases¡£¶ÔÓÚÎÒµÄÀí½â£¬ORACLEÏîÄ¿À´ËµÒ»¸öÏîÄ¿¾ÍÓ¦¸ÃÓÐÒ»¸öÓû§ºÍÆä¶ÔÓ¦µÄ±í¿Õ¼ä£¬¶øMYSQLÏîÄ¿ÖÐÒ²Ó¦¸ÃÓиöÓû§ºÍÒ»¸ö¿â¡£ÔÚ
ORACLE(db2Ò²Ò»Ñù)Öбí¿Õ¼äÊÇÎļþϵͳÖеÄÎïÀíÈÝÆ÷µÄÂß¼­±íʾ£¬ÊÓͼ¡¢´¥·¢Æ÷ºÍ´æ´¢¹ý³ÌÒ²¿É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ