• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 524
  • Last Modified:

vb.net winforms listbox bound

hi,

How do I get selectedText + selectedvalue from a windows form bound  dataset listbox (Single selection listbox)

                 Listbox.ValueMember = "Customer_ID"
                  Listbox.DisplayMember = "Customer_Name"
                  Listbox.DataSource = ds.tables(0).defaultView

 when value selected I Need to get customerID and customer_Name

 

0
sainavya1215
Asked:
sainavya1215
  • 2
1 Solution
 
RonaldBiemansCommented:
DirectCast(ListBox1.SelectedItem, DataRowView).Item("Customer_name")
ListBox1.SelectedValue.ToString
0
 
RonaldBiemansCommented:
although you can omit the tostring :-)

ListBox1.SelectedValue
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now