I hope you can help me to know the difference between these two sentences
something = listBox1.SelectedValue.ToString();
Both your code lines are fine, assuming you've data bound to a dataview. The second line of code simply returns the "value" of the selected item (that is, whatever you've indicated as the ValueMember). The first reaches back into the data binding for your control, finds the row for the selected item, and returns the value in the first column--that value might or might not be the value or display member, depending on how you've coded it.
Is this even CORRECT? I doubt that.
Listbox's selected item would be of type
ListItem. You are trying to cast it into
DataRowView. There should be cannot cast expression error.
Second one looks ok - a valid code line.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)