Showing posts with label specified. Show all posts
Showing posts with label specified. Show all posts

Friday, March 23, 2012

Parameter Available Values

If I have a paramter that has query based available values, how do I get it to use a connection string specified in another paramter to do the query?

The scenario is that I have one set of reports that pull from a number of databases that have identical schemas and each serve a different customer. i need to be able to somehow populate the valid values with the right data from the appropriate database at runtime.

Nevermind, I found it.

I just had to populate an array of ParameterValues with just the connection string and then do a call to GetReportParameters, that made sure that the other parameters had the data that they needed.

Friday, March 9, 2012

Pagination with SP

I'd like to write an SP with parameters that returns specified groups rows
in ordered groups of arbitrary size. Kind of a "sliding" TOP. Like, show me
the first 40 items in a list, show me the 4th group of 40 items in a list,
show me the Nth group of X items, etc. I see this kind of thing all the time
and would prefer not to have to deal with the pagination in VB or ASP, or
get all the rows and then filter out what I don't want to display.
So, I'd like to pass in to the SP parameters for the size of each grouping
and an ordinal for the group I wanted.
CREATE PROCEDURE pagination_sp
@.ordinal int,
@.groupsize int
AS
SELECT LastName, FirstName
FROM People
ORDER BY LastName, FirstName
Thanks for any tips on how to approach this.Don
http://www.aspfaq.com/show.asp?id=2120
"Don Miller" <nospam@.nospam.com> wrote in message
news:%23oKvuTlSFHA.2784@.TK2MSFTNGP12.phx.gbl...
> I'd like to write an SP with parameters that returns specified groups rows
> in ordered groups of arbitrary size. Kind of a "sliding" TOP. Like, show
me
> the first 40 items in a list, show me the 4th group of 40 items in a list,
> show me the Nth group of X items, etc. I see this kind of thing all the
time
> and would prefer not to have to deal with the pagination in VB or ASP, or
> get all the rows and then filter out what I don't want to display.
> So, I'd like to pass in to the SP parameters for the size of each grouping
> and an ordinal for the group I wanted.
> CREATE PROCEDURE pagination_sp
> @.ordinal int,
> @.groupsize int
> AS
> SELECT LastName, FirstName
> FROM People
> ORDER BY LastName, FirstName
> Thanks for any tips on how to approach this.
>