12
Answers

specific cast is not valid in c# mvc

I have a query 

var myquery=from nnn in db.Employees where nnn.empNo=EMPLOYEENO select nnn).FirstOrDefault();

EMPLOYEENO is parameter coming frm method, now in my Emplyees table there are few columns having null values so when this query executes it gives exception "SPECIFIC CAST IS NOT VALID" 

Answers (12)