protected void Button3_Click(object sender, EventArgs e)
{
this.Label1.Visible = false;
this.Tempbind(); }
private void Tempbind()
{
string str = "select FileName,FileLogTime from TempFile where FileBelong='"+Session["Name"].ToString()+"'";
DataTable dt = dbuse.GetTable(str);
if (dbuse.GetTable(str).Rows.Count!=0)
{
this.gv1.DataSource = dt;
this.gv1.DataBind();
}
else
{
this.Label1.Visible = true;
this.Label1.Text = "没有资源!";
}
}
好吧 。它显示不了,没有错误提示,数据库有数据!疯了。
{
this.Label1.Visible = false;
this.Tempbind(); }
private void Tempbind()
{
string str = "select FileName,FileLogTime from TempFile where FileBelong='"+Session["Name"].ToString()+"'";
DataTable dt = dbuse.GetTable(str);
if (dbuse.GetTable(str).Rows.Count!=0)
{
this.gv1.DataSource = dt;
this.gv1.DataBind();
}
else
{
this.Label1.Visible = true;
this.Label1.Text = "没有资源!";
}
}
好吧 。它显示不了,没有错误提示,数据库有数据!疯了。
看你的dt是否有数据
另外if (dbuse.GetTable(str).Rows.Count!=0)没必要这样判断,会再查一次数据了
if(dt.Rows.Count>0)
sql查询没有数据。
{
string str = "select FileName,FileLogTime from PermFile where FileBelong='admin'";
DataTable dt = dbuse.GetTable(str);
this.gv1.DataSource = dt.defaultView;
this.gv1.DataBind();
}
这段 在另外一个页面是可以显示的、
但是拿到刚才的页面就还是不惜那是。
想实现的方法是点一个按钮 则显示这个按钮的数据
count是有值。
而且session已经write出来了。