An exception of type 'System.Data.SqlClient.SqlException' occurred in App_Code.1g52ig0_.dll but was not handled in user code
Additional information: Conversion failed when converting the varchar value 'selvi' to data type int.
I got error like this how to clear this
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Shivanand ArurRank #920 · 2.3K reputationPosted Sep 26, 2012, 3:00 AM EDT
There is some problem due to passing incorrect parameter type.
Pradip PandeyRank #452 · 5.6K reputationPosted Sep 26, 2012, 2:59 AM EDT
This type of error comes when you are trying to convert string value into integer type. So, check your code so that both the sides must be of same type. e.g.
int studentID = int.Parse(Session["StudentID"].ToString());
This is correct but if you write
int studentID = Session["StudentID"].ToString();
This is incorrect.
Hope it will help.