Click here to Skip to main content
14,429,446 members
Rate this:
Please Sign up or sign in to vote.

Im trying to configure a Chart in C# but i keep getting this error Message :
"The variable name <name> as already been declared. Variable names must be unique within a query batch or a storage procedure."

I tried to change the varible name and that message keeps showing.


Heres the code :
declare @var varchar
SET @var = ''

Heres a PrtScreen[^]
Updated 21-May-12 5:41am
sjelen 21-May-12 10:05am
The posted code does not demonstrate the error. Improve question and provide more details.
Member 8956437 21-May-12 10:37am
Its just that, i get that error only by writting that code. I will provide a ScreenShot.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

oh you can't do that on queries in a datasource in .net

you can only write queries like "select ...." "delete...." etc.
but you can not declare stuff like that, if you need it, will have to do it using an stored procedure and select the output from the stored proc.
Member 8956437 21-May-12 12:28pm
Whats that stored procedure?
[no name] 21-May-12 12:34pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100