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.
3.在程序中设置TextBox的TabIndex属性即可.
还有就是第二个问题讲得不明白,说清楚点好吗
private void comboBox1_SelectionChangeCommitted(object sender, System.EventArgs e)
{
......
}
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为空,就出错
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属性即可.
2.使用ComboBox的SelectedIndexChanged事件
3.设置TextBox的Index属性即可.
2。这样简单了,可以这样做
if (combox1.selected){
combox2.items.add(2);
combox2.items.add(2);
combox2.items.add(2);
}
而combo3同理
3。在toolboz菜单中找