Linq to sql Incorrect varchar length
        Posted  
        
            by scott
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by scott
        
        
        
        Published on 2010-04-16T05:26:01Z
        Indexed on 
            2010/04/16
            5:33 UTC
        
        
        Read the original article
        Hit count: 346
        
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.
© Stack Overflow or respective owner