ASP.NETÊý¾Ý°ó¶¨_µÚÈýƪ_ÓÃObjectDataSource¿Ø¼þ°ó¶¨
+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1"
AutoGenerateColumns="true" DataKeyNames="EMPNO">
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetEmp" TypeName="OraEmp">
</asp:ObjectDataSource>
+++ ºǫ́´úÂëÈçÏ£º
// ×Ô¶¨ÒåÀࣺ
using System;
using System.Data;
using System.Configuration;
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 System.Data.OracleClient;
using System.ComponentModel;
public class OraEmp
{
public OraEmp()
{ }
[DataObjectMethod(DataObjectMethodType.Select, true)]
public DataTable GetEmp()
{
string connStr = "Data Source=ora9; uid=scott; pwd=tiger; unicode=true";
string sqlStr = "SELECT * from EMP";
OracleDataAdapter da = new OracleDataAdapter(sqlStr, connStr);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
+++ ˵Ã÷£º
(1) ±¾ÀýʹÓÃObjectDataSource¿Ø¼þ½øÐа󶨣¬Õâ¸ö¿Ø¼þ±ÈSqlDataSource¿Ø¼þ¸ü¼Ó³éÏó£»
(2) Ê×ÏÈ×Ô¶¨ÒåÒ»¸öÀàOraEmp£¬Ìí¼Ópublic DataTable GetEmp()·½·¨£¬×¢Òâ·µ»ØÀàÐÍΪDataTable£»
(3) ÁíÍâÔÚÀàOraEmpÖУ¬ÎªÁËʹÓÃObjectDataSource£¬ÐèÒªÌí¼Ó[DataObjectMethod(DataObjectMethodType.Select, true)]Óï¾ä£¬´ËÓï¾äÐèÒªSystem.ComponentModelÃüÃû¿Ø¼þ£»
(4) ×îºóÉèÖÃObjectDataSource¿Ø¼þµÄSelectMethod="GetEmp"ºÍTypeName="OraEmp"ÊôÐÔ¡£
Ïà¹ØÎĵµ£º
ÐÂÊÖÈçºÎѧϰc#¡¢asp.net¡¢ado.netºÍ.NET
Èç¹ûÄãÒѾÓн϶àµÄÃæÏò¶ÔÏ󿪷¢¾Ñ飬Ìø¹ýÒÔÏÂÕâÁ½²½£º
µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C££»òVB.NET¡£
ÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó£¨OO£©ÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£
ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®OO£¬ÄǾø¶Ôѧ ......
ÔÚa.aspxÌøתµ½b.aspx
ͨ¹ýServer.Transfer("b.aspx") ÓëResponse.Redirect("b.aspx")µÄÇø±ð
Èç¹ûÊÇͨ¹ýͨ¹ýServer.Transfer()ÔÚa.aspxÌøתµ½b.aspxµÄ£¬ÔòÔÚb.aspxÒ³Ã棬¿ÉÒÔ²éÕÒµ½±£´æÔÚa.aspxÒ³ÃæÖÐµÄ ¿Ø¼þÖеÄÖµ£¬Èç¹ûÊÇResponse.Redirect(),ÔòµÃ²»µ½µ½a.aspxÒ³ÃæÖпؼþµÄÖµ¡£
Èç¹ûÊÇͨ¹ýServer.Transfer("b.aspx" ......
ASP.NET,AJAXÎļþÉÏ´«µÄÒÉÎÊ
Ô±¾ÒÔΪÓÃÕâÖÖ·½Ê½£¬°Ñ´Ë·½·¨·Åµ½Ò»¸öHttphandlerÖУ¬È»ºó´ÓJAVASCRIPT·ÃÎÊHttphandlerÀ´ÊµÏÖÎÞˢеÄÎļþÉÏ´«¡£Ã»Ïëµ½£¬ÕâÑùͬÑùÊDz»Ðеģ¬Ö»ÄÜÔÚ±¾»ú²âÊÔͨ¹ý£¬Èç¹û·Åµ½ÍøÉÏ£¬»òÕß´ÓÆäËûµØ·½·ÃÎʾͻáÌáʾÎÞ·¨ÕÒµ½Îļþ£¬¿É¼ûÔÚASP.NETÖÐËüÖ»ÄÜÓÃÓÚÉÏ´«·þÎñÆ÷¶ËµÄÎļþ¡£
֮ǰÔÚÍøÕ¾Ò²Ë ......
Õâ¸öÐèÒªµ½ gougou ÉÏÕÒһϠJMail °²×°ÅäÖÃÒ»ÏÂ
°²×°
[¸úʹÓñð¸ö×é¼þÒ»Ñù£¬ÔÚʹÓÃJmailÓʼþ×é¼þ֮ǰҪÏÈ°²×°»ò×¢²á¸Ã×é¼þJmail.dll¡£
¾ßÌå×¢²á·½·¨£¬ÊÇÏÈ°ÑJmail.dllÎļþ¿½±´µ½Ó²Å̵ÄijһĿ¼Ï£¨ÈçC:\Jmail\Jmail.dll£©
È»ºóÖ´ÐÐÃüÁîRegsvr32 C:\Jmail\Jmail.dll¼´¿É]
ÉÏÔ´Âë
using System;
using System.Data;
......
+++ ASP.NET»º´æÖеÄÊý¾ÝÊDz»Îȶ¨µÄ£¬²»»á±»ÓÀ¾ÃµØ´æ´¢£¬¿ÉÄÜ»áÓÉÓÚÒÔÏÂÔÒòÖ®Ò»¶ø´Ó»º´æÖб»×Ô¶¯ÒƳý£º
1) »º´æÂúÁË
2) »º´æÏîÒѾ¹ýÆÚ
3) »º´æÒÀÀµµÄÏî¸Ä±äÁË
+++ ³ýÁË¿ÉÒÔ×Ô¶¯ÒƳý»º´æÏîÍ⣬Äã¿ÉÒÔÏÔʾÒƳý»º´æÏî¡£ÁíÍ⣬µ±ÄãÓÃInsert·½·¨ºÍAdd·½·¨Ïò»º´æÖÐÌí¼ÓµÄ»º´æÏîÒѾ´æÔÚʱ£¬ÄÇô£¬ÔÀ´µÄ»º´æÏ±»×Ô¶¯É¾³ý¡ ......