0

I have a combobox that is populated by a SQL querry. Problem is the first item of the comboBox where normally the comboBox.text go is blank. You have to drop down the menu item for the items to appear. I want to comboBox to populated with the first item in the first row. I am currently populating my comboBox with the add property

while (oleDbDataReader1.Read() == true)
{
    comboBox1.Items.add = oleDbDataReader1.GetString(0) ;   
}

This though is skipping the first field. How can I add the first result from the query to the first field in my comboBox?

Thanks

7
Contributors
11
Replies
12
Views
9 Years
Discussion Span
Last Post by __avd
0

I think if you changed the DropDownStyle from DropDown to DropDownList*
it may help you

*: from ComboBox control properties window

0

Hi

I have a tabbed control. Tab1 is for adding new customer details and Tab2 is for searching for existing customers (from a comboBox) and then adding additional information for that customer.

How can I make the results of a stored procedure be automatically displayed in the comboBox(DropDownList) as soon as the user clicks on that tab?

Thanks

Elmo

0

Never mind, Sorted :)

Hi

I have a tabbed control. Tab1 is for adding new customer details and Tab2 is for searching for existing customers (from a comboBox) and then adding additional information for that customer.

How can I make the results of a stored procedure be automatically displayed in the comboBox(DropDownList) as soon as the user clicks on that tab?

Thanks

Elmo

0

can anyone say me how to insert the string of combo box into the table in oracle... from VB pls anyone help me with the code....

0

sqldataReader dr = cmd.ExecuteReader();\\cmd is object of sql command
while(dr.Read())
{
comboBox1,Items.Add(dr[0].ToString());
}
con.Close();\\con is a object of sqlconnection

0

Hi

I have a tabbed control. Tab1 is for adding new customer details and Tab2 is for searching for existing customers (from a comboBox) and then adding additional information for that customer.

How can I make the results of a stored procedure be automatically displayed in the comboBox(DropDownList) as soon as the user clicks on that tab?

Thanks

Elmo

you are using sqldatareader or sql dataadapter

0

rs.Open "insert into traveldet values('" & Text1.Text & "' ,'" & saccdate.Text & "','" & sretdate.Text & "','" & stype.Text & "','" & smodel.Text & "','" & Combo1.Text & "','" & Combo2.Text & "',null,'" & snopass.Text & "')", conn, adOpenDynamic, adLockOptimistic, -1

thanks friends...
this code worked for me...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.