I've generated LINQ to SQL classes from a database not under my control which has a lot of Decimal(38, 5)
fields. Apparently the range of the .NET Decimal type is smaller than this, so the LINQ to SQL code generator is throwing a lot of warnings:
DBML1008: Mapping between DbType 'Decimal(38,5)' and Type 'System.Decimal' in Column 'StructGable24InchOCStuds' of Type 'AddersAndMultiplier' may cause data loss when loading from the database
It's extremely unlikely that any of these fields will ever have a value big enough to cause data loss in practice so I'd like to suppress these warnings. However, apparently setting warning suppression through the dialog in VS doesn't work with LINQ to SQL code generator warnings - is there another method?
I am not sure how to suppress the warning but since I have control of the stored procedure that was causing the problem on my system I cast the return value to a smaller decimal which removed the warning.
SELECT CAST(SUM(AdFee) AS DECIMAL(19, 3))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With