Garg,
dropBasis3.SelectedIndex is already a integer value. I quess you come from
javascript /vbscript programming (correct me if i'm wrong) you are trying to
execute equivalent code
var x = parseInt(whatever, 10).
Forget it.
vb.net:
dim str3 as string = Convert.ToString(dropBasis3.SelectedIndex - 1) & ";"
c#:
string str3 = Convert.ToString(dropBasis3.SelectedIndex - 1) + ";"
Or maybe if i didn't get you right, you're trying to parse drop down list
selected value:
vb.net:
Dim result As Integer
Dim str3 As String = IIf(Integer.TryParse(dropBasis3.SelectedValue ,
result), result, 0) & ";"
c#:
int result;
string str3 = int.TryParse(dropBasis3.SelectedValue, out result) ?
result.ToString() : "0";
str3 += ";";
hope this helps
--
Milosz
"Garg" wrote:
Everytime I run my code, it shows an error that the input string is
not in correct format.
Could anybody tell me what is wrong with my line of code?
str3 = Integer.Parse(dropBasis3.SelectedIndex - 1, 10) + ";"