Comboboxes绑定很好,文本框不是那么多

时间:2013-05-28 17:31:20

标签: vb.net binding

似乎这应该很简单。我将组合框成功绑定到Access DB。它看起来像这样:

Dim da As New OleDbDataAdapter(asql, con)
Dim ds As New DataSet
da.Fill(ds)
cboEmployeeNumber.ValueMember = "ID"
cboEmployeeNumber.DataSource = ds.Tables(0)
cboEmployeeNumber.SelectedIndex = 0

效果很好。然后我尝试绑定一个文本框,我根据我尝试的版本得到任意数量的错误。我觉得我这样做是错误的。以下是我尝试过的一些变化没有成功:

txtTypeOfEvaluation.Text = "Classification"
txtTypeOfEvaluation. = ds.Tables(0)
txtTypeOfEvaluation.DataBindings.Add("Text", ds, "2013Employees.Classification")

txtTypeOfEvaluation.DataBindings.Add("Text", ds, "Employees.Classification")

Me.txtTypeOfEvaluation.DataBindings.Add("text", ds.Tables("Employees"), "Classification")

Me.txtTypeOfEvaluation.DataBindings.Add(New Binding("Text", myDataSet.Tables("Employees"), "Classification", True))

txtTypeOfEvaluation.DataBindings.Add(New Binding("Text", ds.Tables("Employees"), "Classification"))

Me.txtTypeOfEvaluation.Text = ds.Tables("Employees").Rows(0).Item(14)

思想?

0 个答案:

没有答案