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

asp.netÒ»Ò¹Ëٳɣº×ܽá&ÉîÈë

ÃüÃû¿Õ¼ä£º
Socut.Data
//##################### CData Àà #####################
ʵÏÖ¹¦ÄÜ£º¶ÁÈ¡(DataSet·½Ê½)£¬²åÈ룬¸üУ¬É¾³ý£¬Í³¼Æ
µ÷Ó÷½·¨£º
public CData myData=new CData();
ʵ¼Ê²Ù×÷£º
1,¶ÁÈ¡
public DataSet ds=new DataSet(); //´ËDataSetÀàÒѾ­ÓÉ΢Èí·â×°Ìṩ
ds=myData.GetDataSet("SELECT * from ±í WHERE Ìõ¼þ",¿ªÊ¼ÐÐ,¶àÉÙÐÐ,"ÐéÄâ±íÃû");
2,²åÈë
myData.GetExecuteNonQuery("INSERT INTO ±í (ÁÐ1£¬ÁÐ2) VALUES (±äÁ¿1,±äÁ¿2)");
2,¸üÐÂ
myData.GetExecuteNonQuery("UPDATE ±í SET ÁÐ1=±äÁ¿A,ÁÐ2=±äÁ¿B WHERE Ìõ¼þ");
3,ɾ³ý
myData.GetExecuteNonQuery("DELETE ±í WHERE Ìõ¼þ");
5,ͳ¼Æ
myData.GetExecuteScalar("SELECT * from ±í WHERE Ìõ¼þ",ͳ¼ÆÀàÐÍ)
ͳ¼ÆÀàÐÍ·ÖÁ½ÖÖ£º
int ÕûÐÍ£º1
double ´øСÊýµã£º2 (¼ÇÒä·½·¨£ºÈç¹ûÄãÖªµÀdoubleÔÚÓ¢Îĵ¥´ÊÖÐÓГ˫±¶”µÄÒâ˼£¬ÄÇôÀàÐͶÔÓ¦Öµ×ÔÈ»¿ÉÒÔÁªÏëµ½“2”)
//##################### CReaderÀà #####################
ʵÏÖ¹¦ÄÜ£º¶ÁÈ¡(DataReaderÔĶÁÆ÷·½Ê½)
µ÷Ó÷½·¨£º
public CReader dr;
ʵ¼Ê²Ù×÷£º
dr=new CReader("SELECT * from ±í WHERE Ìõ¼þ");
//--------------------------------------------
if(dr.Read())
{
//Èç¹ûÌض¨Ìõ¼þµÄÖµ´æÔÚ£¬Á¢¼´ÖÕÖ¹ÏÂÒ»ÐеĶÁÈ¡
}//--------------------------------------------
while(dr.Read)
{
//Ñ­»·¶ÁÈ¡·ûºÏÌõ¼þµÄÖµ
}//--------------------------------------------
µ÷ÓöÁÈ¡³öÀ´µÄÖµ£º
dr["ÁÐÃû"]
ʹÓÃÍêºó¹Ø±Õ£ºdr.Close();
//##################### ¸ü¶àÀ©Õ¹¹¦ÄÜ #####################
1£¬ÈçºÎʵÏÖËÑË÷¹¦ÄÜ£¿
´ð£ºÊ¹ÓÃGetDataSet£¬»òÊÇCreader¶¼¿ÉÒÔʵÏֵģ¬ÒòΪËü¸ù±¾¾ÍÊÇÒ»¸öÊý¾Ý¿âÄÚÈݵĶÁÈ¡¡£¹Ø¼üµÄÖ»ÊÇSQLÓï¾äµÄʹÓã¬Ó¦¸ÃΪSELECT * from ±íÃû1 WHERE ÁÐ1 LIKE ‘ÒªËÑË÷µÄ¹Ø¼ü×Ö’
2£¬ÈçºÎʵÏÖÎÄÕÂÔĶÁ×ÜÊýµÄͳ¼Æ£¿
´ð£ºÐèÒª½«ËùÓзûºÏÒªÇóµÄÁÐ×÷Ò»´Î¼Ó·¨ÔËË㣬ʹÓÃGetExecuteScalarµÄͳ¼Æ¹¦ÄܾͿÉÒÔʵÏÖÁË£¬Ê¾Àý£ºdouble d1=(double)GetExecuteScalar(“SELECT SUM(Ҫͳ¼ÆµÄÁÐÃû) from ±íÃû1 WHERE Ìõ¼þ”,2);
3£¬ÎÒÈçºÎ¿ª·¢ÂÛ̳£¬»òÊÇÉ̳ǣ¿
´ð£ºÂÛ̳µÄ¹¦Äܼ¸ºõ¸úÐÂÎÅϵͳһÑùµÄ£¬ÄãÖ»ÒªÔÙ¼ÓÒ»¸ö»Ø¸´¹¦ÄÜ¡£Ìáʾ£ºÔÚÔ­ÐÂÎűíÖÐн¨Ò»ÁУ¬0´ú±íÖ÷Ìù£¬´óÓÚ0µÄÊý£¬Ôò´ú±í´ËÌùÊǸúÌù¡¢ËùÒª¸úÌùµÄÖ÷ÌùIDÊÇXX¡£É̳ǵĹºÎï³µ£¬ÊÂʵÉϾÍÊÇ


Ïà¹ØÎĵµ£º

asp.netÖÐÓÃtable±í¸ñ°ó¶¨Êý¾Ý

ÆäʵÔÚasp.netÖÐÓÃtable±í¸ñ°ó¶¨Êý¾Ý£¬²¢²»ÒªÏñÔÚaspÖÐÄÇôÂé·³£¬ÄÇôÄÑÀí½â£¬Ò²²»ÒªÓÃʲôѭ»·Óï¾äÀ´Ò»ÏîÏîµÄ¶ÁÈ¡Êý¾Ý£¬È»ºóÌî³ä±í¸ñ.asp.netÖÐÓÐÒ»¸ö½Ð×öRepeaterµÄ¿Ø¼þ,ÎÒÃÇ¿ÉÒÔÖ±½Ó°Ñ±í¸ñǶÈëµ½Repeater¿Ø¼þÖÐ,È»ºóÉèÖÃRepeate¿Ø¼þµÄDataSourceÊôÐÔ²¢ÈÃÆäDataBind()¾ÍOKÁË......
×öÒ»¸ö²âÊÔ:
ÎÒ´´½¨µÄSQLÊý¾Ý¿âÈçÏÂ: ......

[ASP.NET]DataBinder.EvalÓ÷¨

<%# Bind("Subject") %> //°ó¶¨×Ö¶Î
<%# Container.DataItemIndex + 1%> //ʵÏÖ×Ô¶¯±àºÅ
<%# DataBinder.Eval(Container.DataItem, "[n]") %>
ͨ³£Ê¹Óõķ½·¨
<%# DataBinder.Eval(Container.DataItem, "ColumnName") %>
<%# DataBinder.Eval(Container.DataItem, "ColumnName", null) % ......

ASP.NET α¾²Ì¬


asp.netʵÏÖα¾²Ì¬

Ò»¡¢Î±¾²Ì¬µÄÓô¦
ÓÐЩÓû§
¾õµÃ£¬Î±¾²Ì¬ºÍÕ澲̬ʵ¼Ê±»ÊÕ¼Á¿»áÏà²îºÜ´ó£¬Æäʵ²»È»£¬´ÓÄã¸öÈ˽Ƕȣ¬Äã
È¥ÅжÏÒ»ÏÂÒ»¸öÌû×Óµ½µ×ÊÇÕ澲̬»¹ÊÇα¾²Ì¬£¿¹À¼ÆºÜÄÑ¿´µÃ³ö£¬ÒòΪËùν¾²Ì¬µÄÒâ˼£¬¾ÍÊǵØÖ·Öв»´øÎʺţ¬²»´øÎʺŵľÍÊǾ²Ì¬£¬¹ÜËûÊÇÕæµÄ»¹ÊÇαµÄ£¿ËÑË÷Òý
Çæ¿´µÃ³öÂð£¿ËùÒÔ˵£¬Æäʵ² ......

ASP.NET ÖÐÈçºÎ·À·¶SQL×¢Èëʽ¹¥»÷

Ò»¡¢Ê²Ã´ÊÇSQL×¢Èëʽ¹¥»÷?
¡¡¡¡ËùνSQL×¢Èëʽ¹¥»÷£¬¾ÍÊǹ¥»÷Õß°ÑSQLÃüÁî²åÈëµ½Web±íµ¥µÄÊäÈëÓò»òÒ³ÃæÇëÇóµÄ²éѯ×Ö·û´®£¬ÆÛÆ­·þÎñÆ÷Ö´ÐжñÒâµÄSQLÃüÁî¡£ÔÚijЩ±í
µ¥ÖУ¬Óû§ÊäÈëµÄÄÚÈÝÖ±½ÓÓÃÀ´¹¹Ôì(»òÕßÓ°Ïì)¶¯Ì¬SQLÃüÁ»ò×÷Ϊ´æ´¢¹ý³ÌµÄÊäÈë²ÎÊý£¬ÕâÀà±íµ¥ÌرðÈÝÒ×Êܵ½SQL×¢Èëʽ¹¥»÷¡£³£¼ûµÄSQL×¢Èëʽ¹¥
»÷¹ý³ÌÀàÈ磺 ......

asp.net ÇëÇó²ÎÊý´íÎóÒì³£´¦Àí

package com.accp.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.H ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ