| | |
SQL querry Combo Box Question
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 17
Reputation:
Solved Threads: 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
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
C# Syntax (Toggle Plain Text)
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
I think if you changed the DropDownStyle from DropDown to DropDownList*
it may help you
*: from ComboBox control properties window
it may help you
*: from ComboBox control properties window
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
you may also try after filling the ComboBox control to show the first index
C# Syntax (Toggle Plain Text)
comboBox1.SelectedIndex = 0;
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
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
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
Michelle (Junior Developer)
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
Michelle (Junior Developer)
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 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
•
•
Join Date: Oct 2009
Posts: 4
Reputation:
Solved Threads: 0
0
#10 32 Days Ago
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...
thanks friends...
this code worked for me...
![]() |
Similar Threads
- Displaying a list of Databases in a combo box (VB.NET)
- combo box with related records (MS Access and FileMaker Pro)
- Updating Combo Box (Visual Basic 4 / 5 / 6)
- cdo using combo box in my form (ASP)
- Combo Box (C++)
- combo box (PHP)
- combo box (ASP)
- How do I limit text char in Combo box? (VB.NET)
- combo box help (VB.NET)
Other Threads in the C# Forum
- Previous Thread: Save and Retrive Image
- Next Thread: insert combo box value into database table in oracle
| Thread Tools | Search this Thread |
.net access algorithm alignment app array barchart bitmap box broadcast c# c#gridviewcolumn cast check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datatable datetime degrees development draganddrop drawing elevated encryption enum excel file focus form format forms function gdi+ hospitalmanagementsystem httpwebrequest image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml






