Advertisement

04.15.2008 at 03:17PM PDT, ID: 23325473
[x]
Attachment Details

Populating a list box from an sql database

Asked by Cannibal_Jack in Microsoft Visual Basic.Net, .NET, Windows Forms for .Net

Tags: VB.Net

Hi, I'm trying to populate a list box with data from a sql database, I would like to have all the information from a row in the database displayed on one line one the list box. Also when the get button is pressed to take the IDNumber aand convert it to a string. heres what I have...

list box code...
        Dim dataset1 As New DataSet
        dataAda.Fill(dataset1, "TestTable")
        ListBox1.DataSource = dataset1.Tables("TestTable")
        ListBox1.DisplayMember = "IDNumber" "," "name" "," "age"

button code
Dim testString as string
testString = Listbox1.selectedItem("IDnumber")

I know the code wont run, but I have no idea how to set about achieving what I want and its a start I guess, so if theres anyone that can help me? thanks
Start Free Trial
[+][-]04.15.2008 at 03:44PM PDT, ID: 21363452

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.15.2008 at 04:01PM PDT, ID: 21363521

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, .NET, Windows Forms for .Net
Tags: VB.Net
Sign Up Now!
Solution Provided By: junges
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.16.2008 at 12:47AM PDT, ID: 21365566

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628