protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=(local);database=QuerySystemDB;uid=sa;password=sa");
SqlDataAdapter da = new SqlDataAdapter("DELETE FROM LoginTable WHERE UserName = '"+TextBox1.Text+"'", con);
DataSet ds = new DataSet();
da.Fill(ds, "LoginTable");
DataTable dt = ds.Tables["LoginTable"];
this.GridView1.DataSource = dt.DefaultView;//未将对象引用设置到对象的实例。
this.GridView1.DataBind();
}
我不知道那儿应该怎么改,请大家帮我看看
{
SqlConnection con = new SqlConnection("server=(local);database=QuerySystemDB;uid=sa;password=sa");
SqlDataAdapter da = new SqlDataAdapter("DELETE FROM LoginTable WHERE UserName = '"+TextBox1.Text+"'", con);
DataSet ds = new DataSet();
da.Fill(ds, "LoginTable");
DataTable dt = ds.Tables["LoginTable"];
this.GridView1.DataSource = dt.DefaultView;//未将对象引用设置到对象的实例。
this.GridView1.DataBind();
}
我不知道那儿应该怎么改,请大家帮我看看
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货