• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

C# Help Personel DB Project

Fort

Respected Member
Was working on a project and we stumble with this error. Thanks in advance appreciate all the help

28sbss1.jpg
 

Attachments

  • 28sbss1.jpg
    28sbss1.jpg
    75.3 KB · Views: 35

Tommy

Founder
Since SelectedValue doesn't really represent a string, you could try:

Code:
Int32.Parse(DropDownList1.SelectedValue.ToString());

Or, instead of using "int.Parse" you could use "int.TryParse":

Code:
int resultValue = 0;

if ((int.TryParse(DropDownList1.SelectedValue, out result) && (resultValue > 0))
{
    // Do stuff
}
 
Top