Skip to content

OLEDB DataReader Single ToSting Value / Formatting issue #82039

Open

Description

I am pulling data from an OSISoft PI Server using using their OLEDB connection. After doing an execute reader to get one Single value and then calling datareader[1].ToString() method i am getting different results in .Net 4.7 vs .Net 6 (.Net Core).
The value in .Net 4.7 is 198133.8 but in .Net 6 it is 198133.75. I was looking at the Floating-Point Parsing and Formatting improvements in .NET Core 3.0 and was thinking that might be the cause of my issue? Is there any way to configure the OLEDB connection / OLDEB to use the old formatter for floats / decimals ? I have other examples where the Single that is coming back also has two digits after the decimal and it is not rounding the .Net 4.7 value so I am not sure if there is an underlying value that I cannot see that would be causing the rounding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions