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 04:36 PM.
By Sandeep Uppal in forum .NET
Last Post: 07-10-2003, 05:59 AM
Last Post: 02-12-2003, 11:46 PM
By Beginner in forum .NET
Last Post: 08-11-2001, 10:31 AM
Last Post: 04-13-2001, 02:27 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center