datagrid详细页
作者:admin 日期:2008-06-03
//view.aspx
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label> </div>
//------------------------------------------------------------------
//view.aspx.cs
public CData myData=new CData ();
public DataSet ds=new DataSet ();
protected void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string strID=Request["id"];//获取浏览器地址参数id
ds=myData.GetDataSet ("Select n_id,n_title,n_time,n_content FROM socut_news Where n_id='"+strID+"'",0,0,"dsTable");
Label1.Text =ds.Tables ["dsTable"].Rows [0][1].ToString ();//读取虚拟表的第一列(事实上是第二列,因为这是从0开始数)
Label2.Text =ds.Tables ["dsTable"].Rows [0][2].ToString ();
Label3.Text =ds.Tables ["dsTable"].Rows [0][3].ToString ();
}
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label> </div>
//------------------------------------------------------------------
//view.aspx.cs
public CData myData=new CData ();
public DataSet ds=new DataSet ();
protected void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string strID=Request["id"];//获取浏览器地址参数id
ds=myData.GetDataSet ("Select n_id,n_title,n_time,n_content FROM socut_news Where n_id='"+strID+"'",0,0,"dsTable");
Label1.Text =ds.Tables ["dsTable"].Rows [0][1].ToString ();//读取虚拟表的第一列(事实上是第二列,因为这是从0开始数)
Label2.Text =ds.Tables ["dsTable"].Rows [0][2].ToString ();
Label3.Text =ds.Tables ["dsTable"].Rows [0][3].ToString ();
}
评论: 0 | 引用: 0 | 查看次数: 1781
发表评论
你没有权限发表留言!