Linq to sql Incorrect varchar length
- by scott
I have a table with a nullable varchar(50) column in it. When I am updating the value through linq to sql and trace the call in profiler it is defining the parameter as varchar(36). This is obviously causing some minor issues when we are trying to insert data that is between 37 and 50 characters long. I have tried removing the table and re-adding it to the design surface but the same thing happens. I also tried removing that property and adding it manually, same issue. When I look at the designer.cs code it shows the attribute properly:
[Column(Storage="_Name", DbType="VarChar(50)")]
I am out of ideas, anybody seen this before? Every other column is correct.