【发布时间】:2016-12-14 09:13:17
【问题描述】:
我正在尝试从 FoxPro 获取一张表到 C#。我正在使用以下语句;
sqlCmd.CommandText = @"SELECT ew.ew_pplid, ew.ew_name, ew.ew_from, ew_to, ew.ew_totdays
FROM empwork ew
INNER JOIN employs emp ON ew.ew_pplid = emp.em_pplid
WHERE emp.em_netname NOT LIKE ''
AND TRIM(emp.em_netname) <> ''
AND emp.em_type <> 2
AND ew.ew_from > ?";
sqlCmd.Parameters.AddWithValue("pDate", Convert.ToDateTime("01/08/2016"));
但我遇到了一个我从未见过的错误;
The Provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value.
以前有没有人看到过这个错误,如果有,我该如何解决这个问题?
【问题讨论】:
-
顺便说一句,在查询中使用 TRIM() 和 LIKE 意味着它不太可能进行 Rushmore 优化,并且对于大型数据集可能会很慢。