Open manohargaddam opened 8 years ago
What does the object (class) look like here? It is very odd that it is claiming that this is a short
(aka Int16
) value - but that is what is being reported. Also: what is the RDBMS here?
Class - dynamic RDBMS - Pivotal GemFire
Hello!
I also encountered the same problem as you.
But the difference is that the method I am calling is
connection.ExecuteScalar<int>("SELECT colname ", param)
,
and then an exception is reported
System.FormatException : Input string was not in a correct format.
By tracking Dapper's source code I found that my SQL returned an empty string, and Dapper would convert it to an int, which caused this exception. You should check the real result of your SQL return.
The location where Dapper reports error is Dapper.SqlMapper.cs (line 2941). Returns the location of the SQL execution result in Dapper.SqlMapper.cs (line 2825).
I hope my answer will help you a little. (My English is very bad, this comment was translated by Google, may not be well understood)
This seems like an edge case. If the decimal value with precision more than 6 digits & the value is zero, it is unable to cast it.
Interestingly If the decimal value in the DB is anything other than zero, then it is working fine.
Note 1: With decimal value precision is <= 6 everything works fine. Note 2: I had only one row in the table
Table Definition:
Table Data:
When trying to fetch rows is failing.
Exception
In case of additional information please revert back!
Thanks!