views:

124

answers:

1

I currently have an existing database and I am using the LINQtoSQL generator tool to create the classes for me. The tool is working fine for this database and there are no errors with that tool.
When I run a LINQ to SQL query against the data, there is a row that has some invalid data somehow within the table and it is throwing a System.FormatException when it runs across this row. Does anyone know what that stems from? Does anyone know how I can narrow down the effecting column without adding them one by one to the select clause?

+1  A: 

Do you have a varchar(1) that stores an empty string?

You need to change the type from char to string in the designer (or somehow prohibit empties). The .net char type cannot hold an empty string.

David B