数据绑定好的GridView控件在网页上怎么不显示啊
代码如下://从表Ex09_GuestBook中检索出来的数据绑到GridView控件,显示出来privatevoidBindData(){stringselCmd="s...
代码如下:
//从表Ex09_GuestBook中检索出来的数据绑到GridView控件,显示出来
private void BindData()
{
string selCmd = "select * from Ex09_GuestBook where(ParentID=0) order by PostTime DESC";
SqlDataAdapter da = new SqlDataAdapter(selCmd,myConnection);
DataSet ds = new DataSet();
da.Fill(ds, "word");
GridView1.DataSourceID = null;
GridView1.DataSource =ds.Tables["word"].DefaultView;
GridView1.DataBind();
} 展开
//从表Ex09_GuestBook中检索出来的数据绑到GridView控件,显示出来
private void BindData()
{
string selCmd = "select * from Ex09_GuestBook where(ParentID=0) order by PostTime DESC";
SqlDataAdapter da = new SqlDataAdapter(selCmd,myConnection);
DataSet ds = new DataSet();
da.Fill(ds, "word");
GridView1.DataSourceID = null;
GridView1.DataSource =ds.Tables["word"].DefaultView;
GridView1.DataBind();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询