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

2.4k views Asked by At

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.

Thanks for any help!

1

There are 1 answers

0
McArthey On BEST ANSWER

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.

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!