Error previewing data with GetData(parameter) of TableAdapter
Posted: Thu 28 Feb 2008 18:54
When I add a parameter "currencyId" to a TableAdapter and try to preview data I get the error: "Fill,GetData(currencyId) could not be previewed. ‘currencyId’ parameter is missing at the statement"
I am using Core Lab MyDirect .NET 4.30.24.0 and Core Lab MyDeveloper Tools with MySQL Server 5.1.
Has anyone encountered this? Thanks.
Here are the details.
I have this table in MySQL called "currency":
CREATE TABLE `optionstraderii`.`currency` (
`id` char(3) NOT NULL,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
);
I created a TableAdapter for the currency table. I did this by right clicking on the designer page and choosing "Add>Table Adapter…" The TableAdapter is called "currency1TableAdapter" and the DataTable is called "currency1DataTable".
In the QueryBuilder, I set the filter for the id row to "= currencyId". The query is: SELECT id, name
FROM currency WHERE (id = 'currencyId').
I want to change the currency1DataTable.GetData() method to take a string as a parameter. I right click on the TableAdapter in the designer and choose Properties. In the dialog box that appears, I click on the "…" button to the right of the Parameters label.
In the "Parameters Collection Editor" I add a parameter by clicking on the Add button. I chose "Char" from the "ProviderType" drop down menu. I set Size to 3. I set the SourceColumn to id. I set the ParameterName to "currencyId".
In the designer, the currency1 TableAdapter displays the GetData(currencyId) method.
I right click on the currency1 TableAdapter and choose "Preview Data…" The Preview Data dialog box appears. I enter a parameter in to the currencyId row and click the Preview button. I get the error ""Fill,GetData(currencyId) could not be previewed. ‘currencyId’ parameter is missing at the statement""
I tried changing the parameter name to "@currencyId" but the error is the same.
I am using Core Lab MyDirect .NET 4.30.24.0 and Core Lab MyDeveloper Tools with MySQL Server 5.1.
Has anyone encountered this? Thanks.
Here are the details.
I have this table in MySQL called "currency":
CREATE TABLE `optionstraderii`.`currency` (
`id` char(3) NOT NULL,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
);
I created a TableAdapter for the currency table. I did this by right clicking on the designer page and choosing "Add>Table Adapter…" The TableAdapter is called "currency1TableAdapter" and the DataTable is called "currency1DataTable".
In the QueryBuilder, I set the filter for the id row to "= currencyId". The query is: SELECT id, name
FROM currency WHERE (id = 'currencyId').
I want to change the currency1DataTable.GetData() method to take a string as a parameter. I right click on the TableAdapter in the designer and choose Properties. In the dialog box that appears, I click on the "…" button to the right of the Parameters label.
In the "Parameters Collection Editor" I add a parameter by clicking on the Add button. I chose "Char" from the "ProviderType" drop down menu. I set Size to 3. I set the SourceColumn to id. I set the ParameterName to "currencyId".
In the designer, the currency1 TableAdapter displays the GetData(currencyId) method.
I right click on the currency1 TableAdapter and choose "Preview Data…" The Preview Data dialog box appears. I enter a parameter in to the currencyId row and click the Preview button. I get the error ""Fill,GetData(currencyId) could not be previewed. ‘currencyId’ parameter is missing at the statement""
I tried changing the parameter name to "@currencyId" but the error is the same.