add a new row in a combobox
this my code to populate a combobox
Code:
Dim myCmd1 As SqlClient.SqlCommand = cn.CreateCommand
myCmd1.CommandText = "Select emp_name from emp_info"
myCmd1.Connection = cn
Dim da As New SqlClient.SqlDataAdapter()
da.SelectCommand = myCmd1
Dim dt As New DataTable()
da.Fill(dt)
Me.ComboBox1.DisplayMember = "emp_name"
Me.ComboBox1.ValueMember = "emp_name"
Me.ComboBox1.DataSource = dt
i want to add a new row above all emp names.."ALL"..
how do i do that??/
thanks
Re: add a new row in a combobox
This question has been asked and answered many times. You cannot add items to a bound ComboBox. If a ComboBox is bound ten it shows the contents of its DataSource, period. If you want to add items then you have to add them to the DataSource; in your case the DataTable.