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

Ò»¸ö¼òµ¥µÄASP.NET·ÃÎÊMySqlÊý¾Ý¿â

ÏÂÔØ ADO.NET Driver for MySQLMySql.Data.dll
°²×°ºó£¬ÔÚ°²×°Ä¿Â¼ÏÂÃæÕÒµ½Assemblies
Îļþ¼Ð£¬ÕÒµ½ MySql.Data.dll
(´ËÎļþÊÇ.Net·ÃÎÊMySQLÊý¾Ý¿âµÄÒ»¸öÇý¶¯£¬ÍêÈ«ADO.NETÊý¾Ý·ÃÎÊģʽ£¬ÓÉMySQL¹Ù·½Ìṩ£¬Óжà¸ö°æ±¾¿ÉÑ¡Ôñ¡£)
 Ñ§Ï°µÄÒ»¸öÁ´½Ó£ºhttp://www.cnblogs.com/wcfgroup/articles/1242256.html
´´½¨Ò»¸öasp.net µÄÍøÕ¾£¬²¢ÔÚÍøÕ¾ÀïÌí¼ÓÒýÓà MySql.Data.dll
web.config
ÀïÌí¼Ó£º
 <add key="mysqlconn" value="server=192.168.1.102;database=Êý¾Ý¿âÃû;uid=Óû§Ãû;pwd=ÃÜÂë;"></add>
´ËÓû§ÃûºÍÃÜÂëÊÇ°²×°MySqlʱÉèÖõÄ
È»ºó£¬´´½¨Ò»Àà·ÃÎÊMySqlÊý¾Ý¿âµÄÀàÎļþ£ºMySqlClass.cs
Îļþ´úÂëÈçÏ£º
using System;
using System.Collections.Generic;
using System.Web;
using MySql .Data .Types ;
using MySql .Data .MySqlClient ;
using System.Configuration;
using System.Data;
/// <summary>
///MySqlClass µÄժҪ˵Ã÷
/// </summary>
public class MySqlClass
{
private MySqlConnection conn;
private MySqlCommand com;

#region ¹¹Ôì
public MySqlClass()
{
try
{
conn = new MySqlConnection(ConfigurationManager.AppSettings["mysqlconn"]);
conn.Open();
com = new MySqlCommand();
com.Connection = conn;
}
catch (Exception ee)
{
throw new Exception("Á¬½ÓÊý¾Ý¿â³ö´í");
}
}
#endregion
#region »ñÈ¡DataSet
public DataSet GetDataSet(string sqlString)
{
DataSet ds = new DataSet();
try
{
MySqlDataAdapter da = new MySqlDataAdapter(sqlString, conn);
da.Fill(ds);
}
catch (Exception ee)
{
throw new Exception("SQL:" + sqlString + "<br />" + ee.Message.ToString());
}
return ds;
}
#endregion
}
2.´´½¨Ò»¸öaspxÒ³Ã棬²¢ÔÚÒ³ÃæÀïÀ­Ò»¸öGirdview¿Ø¼þ£¬
   <asp:GridView runat="server" ID="GirdView1"></asp:GridVi


Ïà¹ØÎĵµ£º

ASP.NETÖжàѡЧ¹ûÓë¹â°ôЧ¹û£¨ÏÖʵ´úÂ룩

1£© ¶àѡЧ¹û
¶àѡЧ¹ûÍêÈ«¿ÉÒÔͨ¹ý½Å±¾½øÐÐʵÏÖ¡£ÎÒÃÇÖªµÀ£¬¶àÑ¡µÄ¿Ø¼þ×îÖÕÉú³ÉÒ»¸öinputµÄHTML±êÇ©£¬ËüµÄÀàÐÍÊÇcheckbox¡£ÓÉÓÚÕâ¸öÒ³ÃæÖÐÖ»ÓÐÒ»×鸴ѡ¿ò£¬ËùÒÔʵÏÖÆðÀ´Ò²±È½Ï·½±ã£ºÎÒÃÇ¿ÉÒÔ±éÀúËùÓеÄinput±êÇ©£¬¶Ô±ÈÆätypeÊôÐÔÊDz»ÊÇcheckbox£¬Èç¹ûÊÇcheckbox£¬¾Í¸øËüÉèÖÃÏàÓ¦µÄÑ¡ÖÐ״̬¾ÍÐÐÁË¡£
´úÂëÈçÏ£º
<scri ......

ProxoolÀ´Á¬½Ómysql½éÉÜ

±¾ÎÄÖ÷Òª½éÉÜÁ˲ÉÓÃProxoolÀ´Á¬½ÓmysqlµÄ·½·¨£¬Í¨¹ýjava  application·½Ê½¿ÉÒÔÑéÖ¤Êý¾Ý¿âµÄÁ¬½Ó¼°»ñÈ¡±íÖеÄÊý¾Ý¡£ÎªÁËÄܹ»Ó봫ͳµÄJDBC·½Ê½µÄÁ¬½Ó½øÐбȽϣ¬±¾ÎIJÉÈ¡ÁËÁ½ÖÖ·½Ê½½øÐÐÊý¾Ý¿âµÄÁ¬½Ó£¬´úÂëÈçÏ¡£
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java ......

mysql´æ´¢¹ý³Ì

1¡¢Ð½¨±ítest create table test1( field1 int not null ) ENGINE=MyISAM DEFAULT CHARSET=gbk; insert into test1(field1) values(1); 2¡¢É¾³ýÒÑ´æÔڵĴ洢¹ý³Ì -- ɾ³ý´¢´æ¹ý³Ì delimiter // -- ¶¨Òå½áÊø·ûºÅ drop procedure p_test; 3¡¢mysql´æ´¢¹ý³Ì¶¨
1¡¢Ð½¨±ítest
create table test1(
field1 int not null
)
......

ASP.NET ÎÞÏÞ¼¶·ÖÀà

ÏÂͼÖкìÉ«¼ýÍ·ÊǸ¸Àà ¶øÇÒÊôÓÚ¸ùĿ¼¼¶±ð¡£
¡¡¡¡ÏÂÃæ¸ö×Ö¶ÎΪ£ºID¡¡¡¡¸¸ID¡¡ ÀàÐÍÃû³Æ¡¡ Éî¶È¡¡ ÅÅÐò
¡¡¡¡Ç°Ãæ3¸ö×Ö¶ÎûÓÐʲô¿É½âÊ͵ģ¬×ö¹ýÎÞÏÞ¼¶·ÖÀàÉè¼ÆµÄÈ˶¼Ó¦¸ÃÇå³þ
¡¡¡¡¶øµÚ5¸ö×Ö¶ÎÅÅÐò×Ö¶ÎID£º43µÄ23ÅÅÐò´ú±íËûÔÚÕâÕűíÅÅÔÚ23µÄ¸ùĿ¼
¡¡¡¡¶ø23ÏÂÃæµÄ23,01 ˵Ã÷ËûÊÇ2¼¶·ÖÀ࣬ÅÅÔÚ23ÏÂÃæµÄµÚ01¸ö£¬Ò²ÊÇÖ§³Ö99¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ