I need to store email messages in my SQL Server Express database instance. Considering this could be a very long string, I decided to use Text data type in the DB. However, there is no equivalent to this in .NET. Is that a good choice for this type of object to store?
I found out that text is going to be deprecated and developers should use varchar(max) instead. What max value would I have to set then?
What should I use in my WPF application to take that objects? By default, Visual Studio uses string in the code generated by Entity Data Model but is it enough?
You should probably use String and Varchar. In
Varchar(max), max only species the maximum possible length, and does not cause it to be allocated for each row in the table. Same for String.You can use the maximum reasonable (under 2gb) value you want the application to handle.