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£¬ÄǾø¶Ôѧ ......
Ëæ×ÅÍøÂç¼¼ÊõµÄ·¢Õ¹£¬Ä¿Ç°¹úÄÚCMSµÄ¿ª·¢ÉÌÔ½À´Ô½¶à£¬¸÷×Ô¶¼ÓÐÆä¶ÀÌصÄÓÅÊÆ£¬´ó¼ÒÔÚÑ¡ÔñµÄʱºò¾õµÃÑÛ»¨çÔÂÒ£¬²»ÖªµÀÑ¡ÔñÄĸö±È½ÏºÃ£¬ÎÒ¸öÈËÈÏΪ¿ªÔ´µÄCMS»¹ÊÇÊʺÏÎÒÃÇѧϰ¼°Ñо¿Ê¹Óã¬Ï±߾ͼ¸¸ö¹úÄÚµÄasp.net¿ªÔ´CMS½øÐмòµ¥½éÉÜ¡£
1.We7 CMS
We7 CMSÊÇÓÉÎ÷²¿¶¯Á¦¿ª·¢µÄÒ»¿î³ä·Ö·¢¾ò»¥ÁªÍøWeb2.0£¨È粩¿Í¡¢RSSµÈ£©µÄÐÅÏ¢× ......
±¾ÎĽéÉÜÁËASP.NET»ÃæÌøתµÄʵÏÖÒÔ¼°Æä´«ÖµÎÊÌâµÄ½â¾ö·½°¸¡£»ÃæÌøתºÍ´«ÖµÎÊÌ⣬һֱÒÔÀ´¶¼ÔÚÀ§ÈÅןոսӴ¥asp.net webÓ¦ÓóÌÐòµÄ¿ª·¢Õߣ¬Ï£Íû±¾ÎÄÄܶԳõѧÕßÃÇÓÐËù°ïÖú¡£
»ÃæÌøתºÍ´«ÖµÎÊÌ⣬һֱÒÔÀ´¶¼ÔÚÀ§ÈÅןոսӴ¥asp.net webÓ¦ÓóÌÐòµÄ¿ª·¢Õߣ¬ÏÖÂÞÁÐÌøת·½·¨ºÍ´«Öµ·½Ê½¹©´ó¼Ò²Î¿¼£»ÒòΪÎÒ±¾Éí²ÎÓëµÄÏîÄ¿¹¦Ä ......
+++ ÔÚWebÓ¦ÓóÌÐò¿ª·¢ÖУ¬»º´æ¶ÔÓ¦ÓóÌÐòÐÔÄܵÄÌá¸ßÓкܴó°ïÖú¡£±ÈÈ磬ÔÚͬһ¸öÓ¦ÓÃÖУ¬¾³£·¢Éú¶ÔͬһÊý¾Ý¡¢Âß¼¹¦ÄܺÍÓû§½çÃæµÄ¶à´ÎÇëÇó¡£µ±Óû§µÄ»ùÊýºÜ´óʱ£¬Èç¹ûÿ´ÎµÄÇëÇ󶼽øÐд¦Àí£¬Ôò»áÏûºÄºÜ¶àµÄ·þÎñÆ÷×ÊÔ´¡£ÁíÍ⣬ÓÐʱ·þÎñÆ÷ÌṩµÄÊý¾Ý·þÎñ¿ÉÄÜ»áÒâÍâµØÍ£Ö¹£¬Ê¹Óûº´æ¼¼Êõ¿ÉÒÔÔÚÒ»¶¨Ê±¼äÄÚÈÔÈ»Õý³£µØÌṩ¶Ô×îÖ ......