Tag: linq-to-sql

Validating string lengths in LINQ to SQL, or how to fix ‘String or binary data would be truncated’


Warning: Trying to access array offset on false in D:\InetPub\vhosts\vitaminz-794.package\chrisstclair.co.uk\wp-content\plugins\ultimate-social-media-icons\libs\controllers\sfsi_socialhelper.php on line 506

Problem While this error isn’t strictly a C# (the error is actually generated by SQL Server), it’s quite likely that

Continue reading

How to fix ‘Operation is not valid due to the current state of the object’ – LINQ to SQL


Warning: Trying to access array offset on false in D:\InetPub\vhosts\vitaminz-794.package\chrisstclair.co.uk\wp-content\plugins\ultimate-social-media-icons\libs\controllers\sfsi_socialhelper.php on line 506

Problem You’re updating a database record using LINQ to SQL, and upon calling ‘SubmitChanges’ you find that you’re getting the

Continue reading