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

ASP.NET+MYSQL

 MysqlµÄconnector/net5.0ÏÂÔØµØÖ·:
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.6.zip/from/pick
°²×°ºÃÒÔºó,
µãÊôÐÔ,È»ºóµã²éÕÒÄ¿±ê,µãÏòÉÏÒ»²ãĿ¼,ÕÒµ½Binaries\.NET 2.0,È»ºó½«Õâ¸öÎļþ¸´ÖƵ½ÄãµÄ¹¤³ÌĿ¼ÏÂ,Ò»°ãÕâÑùµÄDLLÎļþ»á±£´æµ½binĿ¼ÏÂ.
ÔÚ´úÂëÒ³ÀïÊäÈëusing Mysql.Data.MysqlClient;È»ºóÔÙÔÚPage_Loadº¯ÊýÀïдMysqlConnection£¬ÔÚµ¥´Êдµ½Ò»°ëʱÌáʾ¾Í³öÀ´ÁË£¬ÏÂÃæµÄ¾Í²»ÓÃдÁ˰É?¶¼ÒѾ­³öÏÖ”´úÂëÖÇÄÜÍê³ÉÁË”,Ëæ±ãдһ¶Î´úÂëÊÔÊԾͿÉÒÔÁË,ºÍSqlserverÍêÈ«ÏàËÆ.
ÏÂÃæÌṩÁ½¶Î´úÂ빩²Î¿¼,Ò»¸ö´úÂëÒ³,Ò»¸öÊÇHTMLÒ³:
default2.aspx.csϵĴúÂ룺
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySql.Data.MySqlClient;
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string query = "select * from guestbook";
        MySqlConnection myConnection = new MySqlConnection("server=localhost;user id=root;password=;database=guestbook");
        MySqlCommand myCommand=new MySqlCommand(query,myConnection);
        myConnection.Open();
        myCommand.ExecuteNonQuery();
        MySqlDataReader myDataReader = myCommand.ExecuteReader();
        string bookres="";
        while (myDataReader.Read()==true)
        {
            bookres+=myDataReader["id"];
            bookres+=myDataReader["user"];
&


Ïà¹ØÎĵµ£º

ASP.NET


      ͨ³££¬SQL Óï¾äºÍ´æ´¢¹ý³Ì°üÀ¨ÔËÐÐʱ¼ÆËãµÄ²ÎÊý¡£Ê¹ÓòÎÊý±àдµÄ SQL Óï¾ä³Æ×÷²ÎÊý»¯ SQL Óï¾ä¡£
ʹÓà SqlDataSource ¿Ø¼þʱ£¬¿ÉÒÔÖ¸¶¨Ê¹ÓòÎÊýµÄ SQL ²éѯºÍÓï¾ä¡£Í¨¹ý¸ù¾ÝÔËÐÐʱ¼ÆËãµÄÖµ¶ÁдÊý¾Ý¿âÐÅÏ¢£¬ÕâÓÐÖúÓÚÌáÉýÊý¾Ý°ó¶¨»·¾³µÄÁé»îÐÔ¡£¿ÉÒÔ´Ó¸÷ÖÖÔ´»ñÈ¡²ÎÊýÖµ¡£ÕâЩԴ°üÀ¨ ASP.N ......

ASP.NET


      ¿ÉÒÔʹÓà SqlDataSource ¿Ø¼þÐÞ¸ÄÊý¾Ý¿âÖеÄÊý¾Ý¡£Ê¹Óøüз½°¸ÖÐµÄ SqlDataSource ¿Ø¼þµÄ×î³£Ó÷½·¨ÊǼìË÷Êý¾Ý²¢Ê¹ÓÃÊý¾Ý°ó¶¨ Web ·þÎñÆ÷¿Ø¼þ£¨Èç GridView¡¢DetailsView »ò FormView ¿Ø¼þ£©ÏÔʾÊý¾Ý¡£¿ÉÒÔÅäÖÃÊý¾Ý°ó¶¨¿Ø¼þºÍ SqlDataSource ÒÔ¸üÐÂÊý¾Ý¡£´ó¶àÊýÊý¾Ý°ó¶¨¿Ø¼þ¶¼ÔÊÐíÄú½«Æä ......

ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×ܽá

1.  ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private void Button1_Click(object sen ......

asp.net(vs2005)ʹÓÃupdatepanel¿Ø¼þÏê½â

     ×î½ü×öÒ»¸öÍøÕ¾£¬ÀïÃæÉæ¼°µ½¼¶ÁªµÄÎÊÌ⣨ÈçÊ¡-ÊУ¬Æ·ÅÆ-ÐͺŵÈ), ÎÒÓõÄÊÇDropDownListÀ´ÊµÏֵģ¬ÉèÖø¸¼¶µÄAutoPostBackÊôÐÔÎªÕæ.È»ºóÔÚËüµÄSelectedIndexChanged()ʼþÀïдÏàÓ¦µÄ´úÂ룬ÕâÑù¾ÍÄÜʵÏÖ¼¶Áª¹ØÏµ£¨µ±È»ÕâÀïҪעÒâIsPostBackµÄÎÊÌ⣩.  ×öºÃÖ®ºóÓÃʱ·¢ÏÖÒ»¸ö·Ç³£²»Ë¬µÄÎÊÌ⣬ÄǾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ