1.将数据库所有的字段设为允许为null,或为其添加默认值。
2.在comboBox1失去焦点时设置comboBox2的Value属性。
3.设置TextBox的Index属性即可.

解决方案 »

  1.   

    1.将数据库允许为null的字段添加默认值。
    3.在程序中设置TextBox的TabIndex属性即可.
      

  2.   

    我的数据库设置是允许为null的
    还有就是第二个问题讲得不明白,说清楚点好吗
      

  3.   

    2.在comboBox1的SelectedIndexChanged将comboBox2重新绑定即可
      

  4.   

    你是不是把textBox的值转换了,比如ToString,如果为空,就会出错。
      

  5.   

    2.在combobox有一个事件,你可以在这里面实现与另一个控键的关联
    private void comboBox1_SelectionChangeCommitted(object sender, System.EventArgs e)
    {
    ......
    }
      

  6.   

    没有啊,就像这样的代码
    DataRow anyRow = dataSet1.Tables["tables1"].NewRow();
        anyRow["D1"] = textBox1.Text;
        anyRow["D2"] = textBox2.Text;
        anyRow["D3"] = textBox3.Text;
        anyRow["D4"] = textBox4.Text;

    dataSet1.Tables["tables1"].Rows.Add(anyRow);
    oleDbDataAdapter1.Update(dataSet201);
    dataSet1.tables1.AcceptChanges();
    输入时只要有一个textBox为空,就出错
      

  7.   

    1.将数据库所有的字段设为允许为null,或为其添加默认值。
    2.下面是一个vfp的例子,你看看会有启发的
    combo的init事件
    combo1:
    para p
    local o_para
    o_para=parameters() &&从调用程序中以参数传递数据给私有内存变量或数组
    if o_para>0 &&表单自动加载时不运行
     
    select fenlei1
    set order to tag s_no
    seek thisform.combo1.value
    this.clear()
    scan rest while s_no=thisform.combo1.value
    k=this.listcount+1
    this.list[k,1]=s_name    && 这是菜单显示内容
    this.list[k,2]=second    && 这是菜单值的内容,属性boundcolumn=2
    endscan
    if this.listcount>0
    this.value=this.list[1,2]
    this.enabled=.t.
    else
    this.value=' '
    this.enabled=.f.
    endif
    this.click()
    endif
    combo2:
    para p
    local o_para
    o_para=parameters() &&从调用程序中以参数传递数据给私有内存变量或数组
    if o_para>0 &&表单自动加载时不运行
    select fenlei2
    set order to tag s_no
    seek thisform.combo1.value
    this.clear()
    scan rest while s_no=thisform.combo1.value
    k=this.listcount+1
    this.list[k,1]=s_name   && 这是菜单显示内容
    this.list[k,2]=second && 这是菜单值的内容,属性boundcolumn=2
    endscan
    if this.listcount>0
    this.value=this.list[1,2]
    this.enabled=.t.
    else
    this.value=' '
    this.enabled=.f.
    endif this.click()
    endifcombo3:
    para p
    local o_para
    o_para=parameters()
    if o_para>0 &&表单自动加载时不运行
    select fenlei3
    set order to tag t_id
    seek thisform.combo2.value
    this.clear()
    scan rest while t_id=thisform.combo2.value
    p=this.listcount+1
    this.list[p,1]=t_name  && 这是菜单显示内容
    this.list[p,2]=third   && 这是菜单值的内容,属性boundcolumn=2
    endscan
    if this.listcount>0
    this.value=this.list[1,2]
    this.enabled=.t.

    else
    this.value=' '
    this.enabled=.f.
    endif

    this.click()
    endif
    combo的click事件combo1:
    thisform.combo2.init(2)
    thisform.refreshcombo2:
    thisform.combo3.init(1)
    thisform.refreshcombo3:
    thisform.grid1.init()3.设置TextBox的Index属性即可.
      

  8.   

    1.将数据库字段设为允许为null,或为其添加默认值。
    2.使用ComboBox的SelectedIndexChanged事件
    3.设置TextBox的Index属性即可.
      

  9.   

    1。只要加一个“”就可以了;饿
    2。这样简单了,可以这样做
    if (combox1.selected){
    combox2.items.add(2);
    combox2.items.add(2);
    combox2.items.add(2);
    }
    而combo3同理
    3。在toolboz菜单中找