TableAdapter Query Configuration Wizard doesn't recognize certain parameters in my query

48 views Asked by At

I am setting up table adapters in an xsd file for my project in Visual Studio 2022. The problem I am running into is that, in my query I have parameters in my WHERE clause that are recognized by the table adapter and they work fine, I also have parameters in my ORDER BY clause that are not recognized.

For example I have a query like this

SELECT *
FROM Table
WHERE data = @data
ORDER BY @sortDirection AND @sortField

The problem is that the table adapter recognizes the @data parameters and I when I call the adapter in my DAO I can assign @data a value. However, it does not see @sortDirection and @sortField so when I try to assign them values (In this case I am assigning them to GridView.Attributes("sortDirection") and GridView.Attributes("sortField")) I get an error stating

Too many arguments to 'Public Overridable Function MyFunction() As MyDataset.MyTableAdapter.

Any assistance with this issue would be appreciated.

0

There are 0 answers