string xibie = DropDownList1.SelectedValue;
string zhrscore;
TextBox tb = (TextBox)GridView1.Rows[0].Cells[3].FindControl("TextBox1");
zhrscore = tb.Text; SqlConnection SqlCon = new SqlConnection(ConfigurationManager.AppSettings["SqlConString"]);
string str = "update jieguo set zhrscore='" + zhrscore + "' where dept='" + xibie + "'";
SqlCon.Open();
SqlDataAdapter myda = new SqlDataAdapter(str,SqlCon);
//SqlCommand SqlCmd = new SqlCommand(str,SqlCon);
DataSet myds = new DataSet();
myda.Fill(myds,"jieguo");
//SqlCmd.ExecuteNonQuery();
GridView1.DataSource = myds;
GridView1.DataBind();//此处错误提示:IListSource 不包含任何数据源
SqlCon.Close();
string zhrscore;
TextBox tb = (TextBox)GridView1.Rows[0].Cells[3].FindControl("TextBox1");
zhrscore = tb.Text; SqlConnection SqlCon = new SqlConnection(ConfigurationManager.AppSettings["SqlConString"]);
string str = "update jieguo set zhrscore='" + zhrscore + "' where dept='" + xibie + "'";
SqlCon.Open();
SqlDataAdapter myda = new SqlDataAdapter(str,SqlCon);
//SqlCommand SqlCmd = new SqlCommand(str,SqlCon);
DataSet myds = new DataSet();
myda.Fill(myds,"jieguo");
//SqlCmd.ExecuteNonQuery();
GridView1.DataSource = myds;
GridView1.DataBind();//此处错误提示:IListSource 不包含任何数据源
SqlCon.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货