.net - OverflowException reading decimal value from db -


i have sql server column defined decimal(32,15). when try read using sqldatareader.getvalue(), find maximum db value can accommodated 79,228,162,514,264. larger value throws overflowexception. surprising, since .net decimal type 128 bits , provides 28 29 digits of precision. can explain?

use sqldatareader.getsqldecimal() instead of sqldatareader.getvalue().

here example of problem in detail:

http://weblogs.sqlteam.com/mladenp/archive/2010/08/31/when-does-sql-server-decimal-not-convert-to-net-decimal.aspx


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -