Reputation: 4410
The following code give me invalid cast operation.
The Qty column in my MS Sql server is of type decimal(10,2)
#region SQL Syntax
var sql = "select qty from productarticle where articleid=@articleid and productid=@productid";
#endregion
using (IDbConnection cn = Connection)
{
cn.Open();
return cn.Query<double>(sql, new { articleid = articleid, productid = productid }).Single();
}
If I try to return it as int
, there is no problem.
Any clue?
Upvotes: 2
Views: 2560