Tuesday, March 13, 2012

LINQ - Specified cast is not valid using SingleOrDefault

Was getting the below error when using SingleOrDefault

System.InvalidCastException: Specified cast is not valid

The problem was that I had changed the database schema but forgot to refresh the LinqToSql (DataContext) file

No comments:

Post a Comment