OleDb - As to use named parameters
Posted: Sun Apr 15, 2007 7:19 pm
Hello!
I am evaluating the StimulReport.Net to use it in a Web application.
My reports possess parameters and I possess used pages to get these parameters of the user.
As my application must be able to use Oracle or SQL Server, I am using OleDb as connection with the Database.
I use StimulReport 2007 in Portuguese with Windows XP SP2
I need to use parameters in some consultations, where the same parameter is used more than a time in one same instruction SQL:
SELECT *
FROM SSEmpresa
WHERE (@pCodEmpresa = 0 OR EM_Codigo = @pCodEmpresa)
@pCodEmpresa is used some times in the SQL.
This is only one example. I have several other similar situations.
I am receiving the following message when trying to emit the report (Portuguese Br):
Não foi possível preparar instrução(ões)
É necessário declarar a variável escalar "@pCodEmpresa".
I tried to use the parameters with the character "?", but in this in case that it is necessary to inform value for parameter the same two times.
How I make to use parameters named with OleDb connection?
Thank you,
Weber Miranda.
I am evaluating the StimulReport.Net to use it in a Web application.
My reports possess parameters and I possess used pages to get these parameters of the user.
As my application must be able to use Oracle or SQL Server, I am using OleDb as connection with the Database.
I use StimulReport 2007 in Portuguese with Windows XP SP2
I need to use parameters in some consultations, where the same parameter is used more than a time in one same instruction SQL:
SELECT *
FROM SSEmpresa
WHERE (@pCodEmpresa = 0 OR EM_Codigo = @pCodEmpresa)
@pCodEmpresa is used some times in the SQL.
This is only one example. I have several other similar situations.
I am receiving the following message when trying to emit the report (Portuguese Br):
Não foi possível preparar instrução(ões)
É necessário declarar a variável escalar "@pCodEmpresa".
I tried to use the parameters with the character "?", but in this in case that it is necessary to inform value for parameter the same two times.
How I make to use parameters named with OleDb connection?
Thank you,
Weber Miranda.