i am sending the command in convert.toint

Posted by Pratyusha under ASP.NET on 6/21/2013 | Points: 10 | Views : 461 | Status : [Member] | Replies : 2
Hi,

following error has occured in my coding
Error:.input string was not in a correct format.
var EmpId = Convert.ToInt32(scmd.ExecuteScalar());




Responses

Posted by: Jitendrasoft09 on: 6/21/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
HI,
Hope you are trying well, if you are using var there is no need to convert, better approach is remove convert.ToInt32 or check database Empid is which data type and convert according to that because as error input comes string.

Jitendra Kumar
If my post helps you, plz mark as an answer.

Pratyusha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 6/22/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Prathyusha,
check your datatype if your datatype is varchar means no need to use convert.toint32.
check it once if you hava any doubt about this means raise a query.




Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Pratyusha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response