我有一堆文本框绑定到表适配器,当我填充数据表时,所有文本框中只有一个框会填充,txteducator(数据表中只有一行)。它们的配置完全相同。我已经调试过,数据表中的大多数字段中都有数据,它只是选择只显示一个字段。(我删除了非相关代码和一个非工作示例)
this.txtPracticeName.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.ACCOUNT", false, DataSourceUpdateMode.OnValidation, "");
this.txtEducator.DataBindings.Add("Text", this.dataStore, "CLIENT_INFO.USERNAME", false, DataSourceUpdateMode.OnValidation, "");
下面是所有有效的feild配置代码,其中一个不显示任何内容。
this.txtEducator = new System.Windows.Forms.TextBox();
this.txtPracticeName = new System.Windows.Forms.TextBox();
...
this.tbpPIPracticeInfo.Controls.Add(this.groupBox6);
this.tbpPIPracticeInfo.Controls.Add(this.groupBox5);
this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
private System.Windows.Forms.TextBox txtEducator;
private System.Windows.Forms.TextBox txtPracticeName;
this.groupBox6.Controls.Add(this.txtEducator);
this.groupBox5.Controls.Add(this.txtPracticeName);
...
//
// txtEducator
//
this.txtEducator.Location = new System.Drawing.Point(8, 110);
this.txtEducator.Name = "txtEducator";
this.txtEducator.Size = new System.Drawing.Size(150, 20);
this.txtEducator.TabIndex = 19;
//
// txtPracticeName
//
this.txtPracticeName.Location = new System.Drawing.Point(8, 34);
this.txtPracticeName.Name = "txtPracticeName";
this.txtPracticeName.Size = new System.Drawing.Size(317, 20);
this.txtPracticeName.TabIndex = 4;
我到处都找过了。这两个框在各个方面似乎都相同,为什么我这样做时只有一个显示信息?
client_infoTableAdapter.Fill(dataStore.CLIENT_INFO, txtClinicNumber.Text);
this.ValidateChildren();
放入一个绑定源并通过它进行引导没有什么区别。
edit——validateChildren返回true;
我不知道我改了什么,但txteducator也不再更新了。