我们的SQL Server 2016数据库中有一个表字段(TotalPrice
),数据类型是numeric(20, 3)
。
我在C#中使用了ulong
类型作为属性类型。
public ulong TotalPrice { get; set; }
当我想在我的表中插入一条记录时,出现了以下异常。
我的C#代码用于插入一条记录:没有从DbType UInt64到已知的SqlDbType的映射
const string queryInsertInvoice = @"
INSERT INTO Invoice (CustomerId, Number, TotalPrice, LatestStatusDateTime)
VALUES (@CustomerId, @Number, @TotalPrice, @LatestStatusDateTime)
SELECT SCOPE_IDENTITY();";
var invoiceId = await dbConnection.QueryFirstOrDefaultAsync<int>(queryInsertInvoice, invoice);
我该如何处理使用Dapper 2.0.53遇到的这个问题?