Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ulong support please :) For MSSQL #2110

Open
AlaskanDruid opened this issue Sep 9, 2024 · 5 comments
Open

ulong support please :) For MSSQL #2110

AlaskanDruid opened this issue Sep 9, 2024 · 5 comments

Comments

@AlaskanDruid
Copy link

Hellos,

I ran across this issue when trying to pass a ulong to MSSQL stored procedure via Dapper. I am running across an issue of storing a Steam Id (from Steamworks) to the database. it is of the ulong data type (max: 18,446,744,073,709,551,615). The easiest way to replicate the issue:

  1. Create a table with a field type of Numeric (20,0).
  2. Create a stored procedure that accepts a parameter type of Numeric(20, 0).
  3. Call stored procedure from Dapper, passing along a ulong.

You will get the following exception:

System.ArgumentException: 'The parameter data type of UInt64 is invalid.'

@mgravell
Copy link
Member

question: does it work if you do this in raw ADO.NET?

@AlaskanDruid
Copy link
Author

Wow... I had everything typed out with scripts and everything.. only to find out the ADO.Net does not support the MSSQL Numeric data type... uuuggghhhh. So its a missing data type in ADO.

After fiddling around some more with a workaround... convert everything to Decimals for the DTO objects, and then convert them to their proper ulong format for interacting with steamworks. So table field(s), stored procedure parameters and C# DTOs :/

@mgravell
Copy link
Member

So: is there something that Dapper should do here? do you have an example of what you would like to work?

@AlaskanDruid
Copy link
Author

I am currently unsure. I mean, if Microsoft's own ADO.Net is missing support for all of the MSSQL data types, I am unsure if Dapper could fix that... could it? Could Dapper support the MSSQL Numeric data type? (( for some reason, I thought Dapper was dependent on ADO.Net.

@mgravell
Copy link
Member

Dapper is indeed dependent on ADO.NET; if the underlying driver (Microsoft.Data.SqlClient) supports something, we can try to ensure it works from Dapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants