ASP.NET 4 Breaking Changes #2: LinqToSQL char becomes string
If you are using LinqToSql instead of Entity Framework, you will notice (read compilation errors) that there are come about when you use VS2010 to regenerate the DBML file.
One of these is the fact that previously varchar(1) maps to char, but now it maps to string with a validation check for length > 1.
This will definitely cause errors during compilation especially when you have been using char comparison.
There are 2 ways to resolve this
1. Change the db from varchar(1) to char(1), this will render the dbml correctly as char 1 (Preferred method)
2. Change your code to handle this. but since this is now a string, you will have to make quite a fair bit of changes to ensure you do not put in more than 1 character inside this string. there’s also performance issues since char is always faster in comparison as compared to a string type