1.

Solve : Visual Basic problem?

Answer»

Hi, I'm using visual BASIC with .net framework 4, and I made a program that gets the strings from a table in a database and shows them in a listbox, the listbox shows the elements correctly, but when i try to set a variable with the index string (Label1.Text = listbox1.selecteditem() ) I get System.Data.DataRow or something like that, i want to get the string. Can someone help me?
Thank you.listbox1.selecteditem().ToString()

OR get the actual field you want from the DataRow.Label1.Text = ListBox1.SelectedItem().ToString() not working
I get the text "System.Data.DataRowView" instead of the actual string in the DB QUOTE from: alecsillidan on November 11, 2011, 04:13:46 PM

Label1.Text = ListBox1.SelectedItem().ToString() not working
I get the text "System.Data.DataRowView" instead of the actual string in the DB

You'll need to get the field from the DataRow, then.

Code: [SELECT]ListBox1.SelectedItem("fieldname").ToString()It works fine, thank you for helping me.
Solved.


Discussion

No Comment Found