关于用户控件问题——很奇怪的问题。谢谢 再开头加上:DataList MyDataList = new DataList();就可以了,问题解决了,加分吧!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果是在页面拖进去的DataList会自动生成protected System.Web.UI.WebControls.DataList DataList1;,如果是自己在后台写,则需要new一个DataList,即如larrybest(小飞)所说DataList MyDataList = new DataList(); 解决一定散分,但是还没有搞定了阿。在那里加?protected System.Web.UI.WebControls.DataList MyDataList; private String _category = ""; public String Category { get { return _category; } set { _category = value; } } private void Page_Load(object sender, System.EventArgs e) { SqlConnection myConnection = new SqlConnection("data source = 10.2.6.103;database=pubs;uid=sa;pwd=sa;"); SqlDataAdapter myCommand = new SqlDataAdapter("select * from Titles where type='" + _category + "'", myConnection); DataSet ds = new DataSet(); myCommand.Fill(ds, "Titles"); MyDataList.DataSource = ds.Tables["Titles"].DefaultView; MyDataList.DataBind(); } 解决一定散分,但是还没有搞定了阿。在那里加?protected System.Web.UI.WebControls.DataList MyDataList; private String _category = ""; public String Category { get { return _category; } set { _category = value; } } private void Page_Load(object sender, System.EventArgs e) { SqlConnection myConnection = new SqlConnection("data source = 10.2.6.103;database=pubs;uid=sa;pwd=sa;"); SqlDataAdapter myCommand = new SqlDataAdapter("select * from Titles where type='" + _category + "'", myConnection); DataSet ds = new DataSet(); myCommand.Fill(ds, "Titles"); MyDataList.DataSource = ds.Tables["Titles"].DefaultView; MyDataList.DataBind(); } 【分享】大文件上传 进度条显示 (仿csdn资源上传效果) ASP.net未能加载程序集问题 jquery 查找table tfood 中的a标记 XML + AJAX Accordion 组成的动态菜单 求C#和javascript可以通用的教加密解密函数 |M| 我快哭了 找了一整天的Session丢失 才找到原因,大家看看我的这样做有什么好方法 vs2005的一个小问题(急急急) 能否给用户控件添加一个事件?高手请进!!! 哪位大哥能告诉我在哪能下载到ASP.ET1。1 有关服务器的问题 以流形式下载文件的时候,保存完毕后出现页面上的JavaScript不执行! 简单问题(急)
protected System.Web.UI.WebControls.DataList MyDataList;
private String _category = ""; public String Category
{
get
{
return _category;
}
set
{
_category = value;
}
} private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection myConnection = new SqlConnection("data source = 10.2.6.103;database=pubs;uid=sa;pwd=sa;");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from Titles where type='" + _category + "'", myConnection); DataSet ds = new DataSet();
myCommand.Fill(ds, "Titles"); MyDataList.DataSource = ds.Tables["Titles"].DefaultView;
MyDataList.DataBind();
}
protected System.Web.UI.WebControls.DataList MyDataList;
private String _category = ""; public String Category
{
get
{
return _category;
}
set
{
_category = value;
}
} private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection myConnection = new SqlConnection("data source = 10.2.6.103;database=pubs;uid=sa;pwd=sa;");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from Titles where type='" + _category + "'", myConnection); DataSet ds = new DataSet();
myCommand.Fill(ds, "Titles"); MyDataList.DataSource = ds.Tables["Titles"].DefaultView;
MyDataList.DataBind();
}