It appears that the use of declare is not supported.
1 Answer, 1 is accepted
answered on 12 Jan 2011, 06:57 PM
Variables are declared in the body of a batch or procedure with the DECLARE statement but the SqlDataSource is Executing Queries. Thus if you have to use the Declare statement our suggestion is to utilize stored procedures.