I have number in database, for example 733.25 which is stored as varchar in mssql.
the datareader will read it as string object “733.25”
How can i convert it to long (int64) ?
Int64.Parse returns error
(long)Convert.ToDecimal returns “73325”
Thank you
In .NET make sure to use
InvariantCulture.More Information: MSDN: Using the InvariantCulture Property
In T-SQL you can cast that in your query.
More Information: MSDN: CAST and CONVERT (Transact-SQL)
Both will result in 733.25.
hope this helps