I have a value of: “2.54334881002458E-37” and i keep getting “overflow” exception when i’m using a double.
what should i use to make this work?
Thank you
code snippet:
Dim curries, act, cat As Double
For Each dataRow As DataRow In dt.Rows
curries = dataRow("Activity")
getting the error when i try to assign Activity to curries.
but “activity” is a string in the database….
Double is already 64 bits worth of floating point number.
Can you post code where you are getting this overflow?
Decimal might be worth a shot, but you have to post code so that we can understand the issues you are encountering.
Based on your edit in your post, why are you storing numbers as strings in your database? That is a definite no no…unless you are not doing any sort of arithmaetic operation only then can you store them as varchar / string.
Give us a sample of what the data looks like…I think your issue stems from not converting the string to a decimal, if activity is a string convert it using
DirectCastorCType(cast the value):curries = CType(datarow("Activity"), Double)