Monday, March 19, 2012

how to use parameter in rs?

the database hass a store proc with 3 parameters,
eg.create proc stp_test @.Start varchar(1024),@.End varchar(1024),@.Type
varchar(1024) as......
in the reporting project, it has 3 parameters StartA,EndA,TypeA exactly
like those above.
how to call the store proc in the reporting project?
exec stp_test @.Start=@.StartA,@.End=@.EndA,@.Type=@.TypeA ?
but it does not work,a "must declare @.StartA first" message appears
when previewing.hi,you shuld write in the query string just "stp_test ",then click on Run or
Refresh and the VS will update automaticly the parameters.
"Spirit" wrote:
> the database hass a store proc with 3 parameters,
> eg.create proc stp_test @.Start varchar(1024),@.End varchar(1024),@.Type
> varchar(1024) as......
> in the reporting project, it has 3 parameters StartA,EndA,TypeA exactly
> like those above.
> how to call the store proc in the reporting project?
> exec stp_test @.Start=@.StartA,@.End=@.EndA,@.Type=@.TypeA ?
> but it does not work,a "must declare @.StartA first" message appears
> when previewing.
>|||The above syntax works when the command type is set to
'StoredProcedure', if the command type is set to 'Text' the syntax
would be:
Exec stp_test @.Start, @.End, @.Type
This is also the syntax that must be used when you are using the Report
Wizard and it is asking for the Query String.|||thanks ,it works well.

No comments:

Post a Comment