为什么此时需要一个字符串?

问题描述

从答案或评论到我的问题here,我被引导here

所以我从这里更改了代码:

double _imdbThreshold = 0.0;
(IMDBRating is a Decimal(2,1) data type in the SQL Server (Express) Database.)
...
cmd.Parameters.AddWithValue("@IMDBMinRating",_imdbThreshold);

...对此:

cmd.Parameters.Add("@IMDBMinRating",SqlDbType.Decimal,2,1).Value = _imdbThreshold;

...根据上面链接的文章中的示例:

cmd.Parameters.Add("@Parameter",11,4).Value = MyDecimalVariable;

但是我得到“无法从int转换为字符串”:

enter image description here

?!?

为什么我的“ 1”整数arg出现故障?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)