绑定疑惑?
sda.getDt(str, dtM_WorkOrder);
if (dtM_WorkOrder.Rows.Count - 1 > = 0)
{
txtGxCode.DataBindings.Clear();
txtGxCode.DataBindings.Add(new System.Windows.Forms.Binding( "text ", dtM_WorkOrder, "WorkOrderCode "));
txtGxName.DataBindings.Clear();
txtGxName.DataBindings.Add(new System.Windows.Forms.Binding( "text ", dtM_WorkOrder, "WorkOrderName "));
txtM_Stander.DataBindings.Clear();
txtM_Stander.DataBindings.Add(new System.Windows.Forms.Binding( "text ", dtM_WorkOrder, "ConversionStander "));
txtVersion.DataBindings.Clear();
txtVersion.DataBindings.Add(new System.Windows.Forms.Binding( "text ", dtM_WorkOrder, "Version "));
txtBaseTime.DataBindings.Clear();
txtBaseTime.DataBindings.Add(new System.Windows.Forms.Binding( "text ", dtM_WorkOrder, "BaseTime "));
}
以上为我绑定代码
第一次执行正常绑定,没问题,当我查询时再次绑定,
执行此代码后,form上的控件没有数据显示,表中有数据
不知道是怎么回事,搞不明白!
------解决方案--------------------那就接了