Tutorial :How to find the Property causing the exception?


In Linq to SQL SubmitChanges(ConflictMode.ContinueInConflict) i get Exception:

"String or binary data would be truncated. The statement has been terminated."

But how to figure out the Property causing this? I guess i could start testing 1 by 1 the properties but what will happen if i have numerous properties?


Do you have SP1 installed? Looks like this was fixed.


Great news... I installed SP1 for .Net 3.5 and guess what... they provide detailed information now!!!

Example: "Cannot insert the value NULL into column 'FullQualifiedUserName', table 'WcmsDevEmpty.Users.Users'; column does not allow nulls. INSERT fails. The statement has been terminated."


You can set the Log property on your data context to be a stream (such as Console.Out or a log file) to effectively profile the SQL being executed

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »