解决方案 »

  1.   

    if (!IsPostBack)
    {
            string strUserId = "select bh from information";
            SqlDataReader sqr = odb.ExceRead(strUserId);
            if (sqr.HasRows)
            {
                while (sqr.Read())
                {
                    DropDownList1.Items.Add(sqr["bh"].ToString());
                }
                ListItem li = new ListItem("请选择", "0");
                DropDownList1.Items.Insert(0, li);
            }
            sqr.Close();
     }
      

  2.   

    下面这个判断,Insus.NET一般用下面的语句来实现:
      

  3.   

    最基本的问题,不能更新,是因为你写的sql语句是数据插入语句:
    insert into 更新的语句应该是update   ...  where ...
      

  4.   


    谢谢你了   照着你上面的改了,但还是点DropDownList后,下面的文本框没反应,直接修改数据也不行
      

  5.   

    你写的还有一个方法:protected void Button2_Click(object sender, EventArgs e)
        {
            this.TextBox1.Text = this.TextBox3.Text = this.TextBox4.Text = this.TextBox5.Text = this.TextBox7.Text = this.TextBox8.Text = this.TextBox9.Text = this.TextBox10.Text = "";
        }
    可以参考下面的方法来重构:
    http://www.cnblogs.com/insus/p/4120889.html
      

  6.   


    其实,LZ用的是RadioButtonList,因此根本无需判断:
      

  7.   

    你的Page_load里没加 !IsPostBack ,也就是说你的下拉框每次都是重新加载的数据,根本就没执行切换操作
    还有你的下拉框还需要设置AutoPostBack=true