I am a vijay. I am need to compare 2 items from 2 separate drop down lists. These values are of int type. Say for example 2 drop down lists showing years. Now i need to find out these 2 years selected is greater or nearer to the current year.
I tried converting the values i receive from the drop down lists to int variables. But i am getting error then. I gave it like below.
int tmp = Convert.ToInt32 (ddl_1.Selected Item.Text);
this gives an error like this - Input string was not in correct format.
Can somebody help me with this. I need to know how to put an item from a drop down list to a variable of int data type.
I tried converting the values i receive from the drop down lists to int variables. But i am getting error then. I gave it like below.
int tmp = Convert.ToInt32 (ddl_1.Selected Item.Text);
this gives an error like this - Input string was not in correct format.
Can somebody help me with this. I need to know how to put an item from a drop down list to a variable of int data type.
Comment