OleDbCommand.Prepare方法要求类型为'14'的参数具有明确设置的Precision和Scale [英] OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale

查看:120
本文介绍了OleDbCommand.Prepare方法要求类型为'14'的参数具有明确设置的Precision和Scale的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2010,尝试使用DataSet设计器时遇到错误。错误如主题中所述, OleDbCommand.Prepare方法要求类型为'14'的参数具有明确设置的Precision和Scale。

我在连接了几个表的TableAdapter中创建了一个查询并从联接中返回四列。然后,我尝试在设计器中向DataTable添加列并收到错误。
输入查询后,该错误也会出现在TableAdapter配置向导的末尾。

Using Visual Studio 2010 and I'm encountering an error when attempting to use the DataSet designer. The error is as stated in the subject, "OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale."
I have created a query in a TableAdapter that joins a few tables and returns four columns from the join. I then try to add columns to the DataTable in the designer and receive the error. This error also appears at the end of the end of the TableAdapter Configuration Wizard after entering the query.

The wizard detected the following problems when configuring the TableAdapter:"DataTable1":

Details:

    Generated SELECT statement.
    OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale.

To add these components to your dataset, click Finish.

除此错误/警告外,其他所有功能似乎均正常。由于这是自动生成的代码,因此我不确定从哪里开始查找。

Everything appears to function OK except for this error/warning. Since this is auto-generated code I'm not sure where to begin looking.

谢谢您的帮助!

推荐答案

最后,我能够简单地解决这个问题。在DataSet设计器中,如果右键单击TableAdapter,则可以选择查看属性。在属性面板中,有一个参数条目。就我而言,它显示为(集合),并允许我单击它旁边的展开省略号。展开后,您会在左窗格的成员下看到列出的参数。在右侧窗格中,您可以设置精度和刻度。

只要是我的话题,这里就是精度和刻度的快速定义。

In the end, I was able to solve this simply. In the DataSet designer if you right-click on the TableAdapter you can choose to view the Properties. In the Properties panel there is an entry for Parameters. In my case, it displayed '(Collection)' and allowed me to click the expand ellipsis next to it. After expanding you will see the parameters listed under 'Members' in the left pane. The right-hand pane will allow you to set the Precision and Scale.
As long as I'm on the topic, here is a quick definition of Precision and Scale.

精度是数字中的位数。小数位数是数字中小数点右边的位数。例如,数字123.45的精度为5,小数位数为2。

Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.

我希望这对某人有帮助!

I hope this helps someone!

这篇关于OleDbCommand.Prepare方法要求类型为'14'的参数具有明确设置的Precision和Scale的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆