利用两个联动下拉框作为条件。选出数据。用gridview显示出来。
在对GRIDVIEW进行了一些编辑。两个radiobutton。一个DDL 。一个TEXTBOX。
如图,我点下面的button把gridview中的值。传到数据库的另外一个表中、
这个该如何实现。
谢谢!~ 

解决方案 »

  1.   

        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) //更新
        {
            SqlConnection c = gc();
            c.Open();
            string n = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.Trim();
           Label1.Text= GridView1.Rows[e.RowIndex].Cells[3].Text.ToString();
            string s = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.Trim();
            string h = ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.Trim();
            string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
            string sql = "update tb_StuInfo set stuName='" + n + "',stuSex= '" + s + "',stuHobby= '" + h + "' where stuID="+Convert.ToInt32(id);
            SqlCommand cmd = new SqlCommand(sql, c);
            cmd.ExecuteNonQuery();
            c.Close();
            GridView1.EditIndex = -1;
      b();希望对你有帮助 这个和你的情况差不多
      

  2.   

    我只有2列保存 是第3 和4列的textbox
      

  3.   

    http://www.ie512.com/news.aspx?id=205&no=1国外空间,打开有点慢,看看有没有你要的思路
      

  4.   

    这个问题解决了吧?用findcontrol.
      

  5.   

    wxr0323是否可以加你的联系方式?有很多问题想请教你。。