G
Guest
Hi,
I would like to populate some data (4 records) to a ComboBox from Datatable
with an empty row as first row.
Here is what I did...
\\\
Dim dr as datarow
dr = Datatable1.NewRow
dr("ColumnName1") = ""
dr("ColumnName2") = ""
ComboBox1.Items.Add(dr)
For Each dr In Datatable1.rows
ComboBox1.Items.Add(dr)
Next
ComboBox1.ValueMember = "ColumnName1"
ComboBox1.DisplayMember = "ColumnName2"
///
However, when I run it, I only got 5 row of "System.Data.DataRow"
I did exactly the same thing on the other form before but it worked.
Am I missing something?
Please help and thanks in advance.
I would like to populate some data (4 records) to a ComboBox from Datatable
with an empty row as first row.
Here is what I did...
\\\
Dim dr as datarow
dr = Datatable1.NewRow
dr("ColumnName1") = ""
dr("ColumnName2") = ""
ComboBox1.Items.Add(dr)
For Each dr In Datatable1.rows
ComboBox1.Items.Add(dr)
Next
ComboBox1.ValueMember = "ColumnName1"
ComboBox1.DisplayMember = "ColumnName2"
///
However, when I run it, I only got 5 row of "System.Data.DataRow"
I did exactly the same thing on the other form before but it worked.
Am I missing something?
Please help and thanks in advance.