show details of first record

Discussion in 'ASP General' started by Bryan Harrington, Apr 18, 2005.

  1. I have a list of requests that I'm displaying. The client wants to be able
    to display the details of the FIRST request as the page loads.

    Right now, as I loop through the recordset, I'm checking the querystring for
    "rid", and if rid = "" then I do a response.redirect to the page adding the
    rid value to the querystring from the recordset.

    I'm thinking this is not very effecient, but I can't figure out anything
    better.. anyone have a good solution to show the details of the first item
    on the list?

    Thanks!
     
    Bryan Harrington, Apr 18, 2005
    #1
    1. Advertising

  2. I don't understand what the "rid" has to do with what you're trying to do.
    Can you show us what you're doing somehow?

    Ray at work

    "Bryan Harrington" <> wrote in message
    news:%...
    > I have a list of requests that I'm displaying. The client wants to be

    able
    > to display the details of the FIRST request as the page loads.
    >
    > Right now, as I loop through the recordset, I'm checking the querystring

    for
    > "rid", and if rid = "" then I do a response.redirect to the page adding

    the
    > rid value to the querystring from the recordset.
    >
    > I'm thinking this is not very effecient, but I can't figure out anything
    > better.. anyone have a good solution to show the details of the first item
    > on the list?
    >
    > Thanks!
    >
    >
     
    Ray Costanzo [MVP], Apr 18, 2005
    #2
    1. Advertising

  3. As I loop through the recordset, I have these lines of code:

    ......
    do until rswl.eof
    if request.querystring("rid") = "" then
    response.redirect("worklist.asp?rid=" & rswl("reject_id") & "&Page=" &
    iCurrentPage )
    end if
    ......
    etc..

    I need to grab the first item on the list and show it's details, and the
    above works, but just doesn't seem effecient to me, but I don't really want
    to do a select top 1 (because the sql is pretty big, and pretty dynamic
    (based on user login)), and then open the full recordset again.. that
    doesn't seem effecient either.


    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:%...
    > I don't understand what the "rid" has to do with what you're trying to do.
    > Can you show us what you're doing somehow?
    >
    > Ray at work
    >
    > "Bryan Harrington" <> wrote in message
    > news:%...
    > > I have a list of requests that I'm displaying. The client wants to be

    > able
    > > to display the details of the FIRST request as the page loads.
    > >
    > > Right now, as I loop through the recordset, I'm checking the querystring

    > for
    > > "rid", and if rid = "" then I do a response.redirect to the page adding

    > the
    > > rid value to the querystring from the recordset.
    > >
    > > I'm thinking this is not very effecient, but I can't figure out anything
    > > better.. anyone have a good solution to show the details of the first

    item
    > > on the list?
    > >
    > > Thanks!
    > >
    > >

    >
    >
     
    Bryan Harrington, Apr 18, 2005
    #3
  4. Well, this is inefficient if request.queryting("rid") is empty, since
    that'll be evaluated every time, and you'll loop through the recordset for
    nothing.

    What is rid? Why are you passing a value in a querystring that you aren't
    using? Is that an ID number? Is that value not already known and available
    elsewhere in your code?

    Response.Redirect "worklist.asp?rid=" & rswl("reject_id") & "&page=" &
    iCurrentPage

    You know it's going to be the first record in the recordset anyway, right?

    Ray at work

    "Bryan Harrington" <> wrote in message
    news:%...
    > As I loop through the recordset, I have these lines of code:
    >
    > .....
    > do until rswl.eof
    > if request.querystring("rid") = "" then
    > response.redirect("worklist.asp?rid=" & rswl("reject_id") & "&Page=" &
    > iCurrentPage )
    > end if
    > .....
    > etc..
    >
    > I need to grab the first item on the list and show it's details, and the
    > above works, but just doesn't seem effecient to me, but I don't really

    want
    > to do a select top 1 (because the sql is pretty big, and pretty dynamic
    > (based on user login)), and then open the full recordset again.. that
    > doesn't seem effecient either.
    >
    >
    > "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    > message news:%...
    > > I don't understand what the "rid" has to do with what you're trying to

    do.
    > > Can you show us what you're doing somehow?
    > >
    > > Ray at work
    > >
    > > "Bryan Harrington" <> wrote in message
    > > news:%...
    > > > I have a list of requests that I'm displaying. The client wants to be

    > > able
    > > > to display the details of the FIRST request as the page loads.
    > > >
    > > > Right now, as I loop through the recordset, I'm checking the

    querystring
    > > for
    > > > "rid", and if rid = "" then I do a response.redirect to the page

    adding
    > > the
    > > > rid value to the querystring from the recordset.
    > > >
    > > > I'm thinking this is not very effecient, but I can't figure out

    anything
    > > > better.. anyone have a good solution to show the details of the first

    > item
    > > > on the list?
    > > >
    > > > Thanks!
    > > >
    > > >

    > >
    > >

    >
    >
     
    Ray Costanzo [MVP], Apr 18, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?R3JlZw==?=

    Hide / Show Details

    =?Utf-8?B?R3JlZw==?=, Apr 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    415
    =?Utf-8?B?RGF2ZSBCcml0dG9u?=
    Apr 15, 2005
  2. Michel Couche

    Datalist: "hide/show" more details

    Michel Couche, Feb 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    504
    Michel Couche
    Feb 1, 2006
  3. =?Utf-8?B?Sm9l?=

    Show Details/Hide Details link button

    =?Utf-8?B?Sm9l?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    916
    dkode
    Mar 13, 2006
  4. Guest
    Replies:
    7
    Views:
    680
    Walter Wang [MSFT]
    Jun 28, 2006
  5. woodfoot

    Master/Details cloning a record?

    woodfoot, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    204
    Phillip Williams
    Mar 21, 2006
Loading...

Share This Page