This is a migrated thread and some comments may be shown as answers.

Must declare the scaler variable 'error'

1 Answer 136 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pete Haberstroh
Top achievements
Rank 1
Pete Haberstroh asked on 21 Apr 2009, 02:03 PM
I am trying to build a query with a parameter in it and get the following error
"Must declare the scaler variable"

I am using Visual Studio 2008 and telerik reporting Q3
could someone please tell me how to get around this problem
my query string looks like this

SELECT     ProNumber, HoldCodes, Ship, Pieces, Weight, SkidSpaces, SrprhID
FROM         RouteDetail
WHERE     (SrprhID = @Param1)

the excution of the query works fine
thanks
Pete

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Apr 2009, 02:30 PM
Hello Pete,

Indeed parameters in query would not be recognized by our datasource wizard and this is a known limitation. You can however remove the parameters from the query, finish the wizard, then edit the dataset, add the parameters to your query and save it. You can use the data set designer to edit your query. But if you experience any troubles with the data set designer you still have a chance to edit the query (by hand). In the Solution Explorer locate your data set (the typed data sets files has .XSD extension), right click to open the context menu and choose the "Open With ..." option. From the Open With- dialog please select the "XML Editor" option and press the OK button. This will open the typed data set file in the XML editor instead in the data set designer. Locate the SelectCommand/DbCommand element where is the actual query and replace it with the new one (this is usually near the top of the file and the path should be something like this: DataSource/Tables/TableAdapter/MainSource/DbSource/SelectCommand/DbCommand). Saving the XSD file should case the underlying code to be re-generated and from now on the new query should take effect. I know this is not the best way to edit a typed data set but may save you in case you have hard time using the default Visual Studio Data Set designer.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Pete Haberstroh
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or