Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
53942 Points
8147 Posts
Jul 21, 2010 10:35 PM|LINK
Check if the empno is an integer to compare
and make sure you check for null values in the TextEmpno.Text
if the text is blank, it will fail in casting to integer
a quick solution for that will be using Convert.ToString on both sides which again depends on your scenario
as
Convert.ToString(p.empno)==txtEmpno.Text
correct me if I am wrong
sansan
All-Star
53942 Points
8147 Posts
Re: LINQ - Specified cast is not valid
Jul 21, 2010 10:35 PM|LINK
Check if the empno is an integer to compare
and make sure you check for null values in the TextEmpno.Text
if the text is blank, it will fail in casting to integer
a quick solution for that will be using Convert.ToString on both sides which again depends on your scenario
as
Convert.ToString(p.empno)==txtEmpno.Text
correct me if I am wrong