private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
//要同时绑定多个数据源,该如何处理??
this.DataList1.DataSource=(Hashtable)Session["bus"]; this.DataList1.DataBind();
this.DataList1.Dispose();
this.DBbind();
}
}
private void DBbind()//数据绑定的方法
{
string bookID=Request.QueryString["bookID"];
SqlConnection con=DB.connentionDB();
SqlDataAdapter da=new SqlDataAdapter();
DataSet ds=new DataSet();
da.SelectCommand=new SqlCommand("select * from books where bookID="+Convert.ToInt32(bookID)+"",con);
da.Fill(ds,"temp");
this.DataList1.DataSource=ds.Tables["temp"];
this.DataList1.DataBind();
}
这样绑定,编译时报错????
请求各住C#.NET编程高手,指教一下,一定给高手!!!急呀
如果现成代码可以发给我的邮件:[email protected] 或者是:Liujunaccp@21cn,com
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货