Need help in programmatically accessing the data returned by data access method...

Discussion in 'ASP .Net' started by Siva, Apr 17, 2006.

  1. Siva

    Siva Guest

    Hi,
    In my ASP.Net 2.0 app, I have a gridview whose data is being
    populated using an object data source which retrieves data from a data
    access layer. The Select method returns a static list of orders. The
    order contains a bunch of data retrieved from SQL server.
    I do display only a part of them in my Gridview by using
    <asp:BoundField. I do , however need to access the remaining fields
    which are part of the order programmatically from my codebehind file.
    Can anyone help with how I can go about doing that?

    Thanks
    -Siva Ramaswami
     
    Siva, Apr 17, 2006
    #1
    1. Advertising

  2. RE: Need help in programmatically accessing the data returned by data

    Siva...

    You didn't say what specific class the "object data source" belongs to. As
    long as it's not database attached (like a SqlDataReader, for example), you
    should be able to simply set a reference to it, in code-behind, and access
    any data it contains via that reference. If you need that data on subsequent
    round-trips, just persist the reference in session state.

    By some definitions, a "data access layer" is stateless, which might mean
    that it will be up to you to persist any data that it returns (potentially,
    placing a reference in session state would still be sufficient). You
    indicated that "The Select method returns a static list of orders". If it is
    an ArrayList, for example, you just need to declare an arraylist and code
    your call to the Select method to return its results to that reference.
    Then, set the DataSource property of your GridView to that same reference.

    So, determine what class you are dealing with, and go from there.

    HTH


    --
    Richard Laird, MCSD.NET


    "Siva" wrote:

    > Hi,
    > In my ASP.Net 2.0 app, I have a gridview whose data is being
    > populated using an object data source which retrieves data from a data
    > access layer. The Select method returns a static list of orders. The
    > order contains a bunch of data retrieved from SQL server.
    > I do display only a part of them in my Gridview by using
    > <asp:BoundField. I do , however need to access the remaining fields
    > which are part of the order programmatically from my codebehind file.
    > Can anyone help with how I can go about doing that?
    >
    > Thanks
    > -Siva Ramaswami
    >
    >
     
    =?Utf-8?B?UmljaA==?=, Apr 17, 2006
    #2
    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. some0779
    Replies:
    0
    Views:
    314
    some0779
    Jun 18, 2005
  2. Replies:
    3
    Views:
    336
    Chris Uppal
    Mar 10, 2006
  3. Replies:
    0
    Views:
    358
  4. kj7ny
    Replies:
    9
    Views:
    285
    Peter Otten
    Aug 9, 2007
  5. Isaac
    Replies:
    0
    Views:
    318
    Isaac
    Mar 3, 2010
Loading...

Share This Page