VB.NET - getting selected value from dropdown - Asked By SVK N on 26-Sep-12 12:18 PM

this is wht i get in debug

    SelectedIndex: 0
SelectedItem: {System.Data.DataRowView}
SelectedText: ""
SelectedValue: {System.Data.DataRowView}
SelectionLength: 0
SelectionStart: 0
i jst want the selected item value
how do i get it

in windows based application i hve a dropdown populated with names from db 
Jitendra Faye replied to SVK N on 27-Sep-12 01:24 AM
Try this-

SelectedItem.ToString().
SVK N replied to Jitendra Faye on 27-Sep-12 10:53 PM
even on using .tostring i get  {System.Data.DataRowView}
Jitendra Faye replied to SVK N on 28-Sep-12 12:40 AM
First check that what value you are binding to the DropDownList items.
SVK N replied to Jitendra Faye on 28-Sep-12 09:03 AM
?drpemp.selectedvalue.tostring()
"System.Data.DataRowView" i hve binded correctly
Cos mos replied to SVK N on 01-Oct-12 05:35 AM
check dropdown textField and ValueField is binded to proper data.

Example:

DropDownList.DataValueField = "Value";
DropDownList.DataTextField = "Text";