Trouble in getting combobox populated in windows form!
I want to populate a combobox in windows form in vb.net, but I am having trouble to get it right, here is my code:
Private Sub cboTALXChkDt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTALXChkDt.Click
Dim cmdCheckDate As New SqlCommand
Dim dtrCheckDate As SqlDataReader
Dim conGPDb As New SqlClient.SqlConnection
conGPDb.ConnectionString = "....................."
.CommandText = "SELECT DISTINCT CHEKDATE FROM UPR30300 WHERE YEAR1 = 2006 ORDER BY CHEKDATE"
.Connection = conGPDb
dtrCheckDate = cmdCheckDate.ExecuteReader()
cboTALXChkDt.SelectedIndex = 0
1. When it's populated, the name of combobox shows up in the box, followed by the items. How to prevent this name of combobox showing up in the box when it's populated? (the first item gets populated after I clicked the dropdown arrow).
2. It shows only one item for the first time I clicked the dropdown arrow of combobox, but the 2nd time I click it, it populates more items to view.....I need it to be populated 10 items a time, so Any suggestion?
Please help. Thank you.
Last edited by JenHu; 03-02-2006 at 05:36 PM.
By Sandeep Uppal in forum .NET
Last Post: 07-10-2003, 06:59 AM
Last Post: 02-13-2003, 12:46 AM
By Beginner in forum .NET
Last Post: 08-11-2001, 11:31 AM
Last Post: 04-13-2001, 03:27 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL