Click here to Skip to main content
15,905,785 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a case where I want to display data from a dataset to a listbox... the dataset contains data i've checked that, but all I retrive is a blank listbox.
My code looks like this

VB
Lst1.DataSource = ds.Tables(0)
        Lst1.ValueMember = "IDN"
        Lst1.DisplayMember = "IDN"
Posted

VB
Dim ds As New DataSet()
Dim da As New System.Data.SqlClient.SqlDataAdapter("Query String", con)
da.Fill(ds, "DemoName")'give any name
Lst1.DisplayMember = "IDN" 'give field name which you want's to display in list box.
Lst1.DataSource = ds.Tables("DemoName")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900