Question Form 2 to From 1 data add

anil3b2

Member
Joined
Jun 19, 2009
Messages
14
Programming Experience
1-3
Hi All,

I have form 1 which is having combo box1 control and this includes some datas from DB. If anything new item i need to add i have a item called "Add new". if the user selects this item new window will pop up to get the input. Now the probelm is i have to add this item in to form 1 combobox1 items. how can i do this?

Please help me.

If ComboBox1.SelectedItem.ToString = "Add New" Then
newstylename = ""
Dim frm As New Input
frm.Label1.Text = "Style_Name"
frm.Show()
End if
 
Like below,

myCommand = New SqlCommand("Select * from Details", myConnection)
'executing the command and assigning it to connection
dr = myCommand.ExecuteReader()
While dr.Read()
If Not dr("Style_Name").ToString = "" Then
If ComboBox1.Items.Contains(dr("Style_Name").ToString) = False Then
ComboBox1.Items.Add(dr("Style_Name").ToString)
End If
End If
End While
 
Back
Top