ASP Migration - Moving Through DataSets

Discussion in 'ASP .Net' started by Don Miller, Dec 17, 2006.

  1. Don Miller

    Don Miller Guest

    In my migration from ASP to ASP.NET 2.0, I have a fair number of complicated
    HTML tables that defy anything .NET can do. Using classic ASP I created
    these tables (by string concatenation) by moving forward, and at times,
    backward through a recordset (using a static cursor rather than a
    forward-only cursor).

    I can't seem to find any methods in .NET to move to a previous row in a
    Dataset (e.g. MovePrev, MoveFirst). Am I trying to use the wrong object to
    navigate through rows of data returned from a database query? Is there a
    better way?

    Thanks for any direction.
    Don Miller, Dec 17, 2006
    #1
    1. Advertising

  2. To answer your question, a Dataset contains a collection of DataTables. A
    DataTable contains a collection of Rows. You can use just an integer index
    to navigate through it.

    Generally speaking, asp.net is object-oriented, not procedure-oriented.
    Several server controls, such as repeater, datalist and gridview, can
    produces a databound html table with item (row) structure of any complexity.
    Trying using asp.net in the classic asp way won't be productive and will be
    always annoying you. Something like driving an airplane instead of flying
    it.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "Don Miller" <> wrote in message
    news:O$...
    > In my migration from ASP to ASP.NET 2.0, I have a fair number of
    > complicated HTML tables that defy anything .NET can do. Using classic ASP
    > I created these tables (by string concatenation) by moving forward, and at
    > times, backward through a recordset (using a static cursor rather than a
    > forward-only cursor).
    >
    > I can't seem to find any methods in .NET to move to a previous row in a
    > Dataset (e.g. MovePrev, MoveFirst). Am I trying to use the wrong object to
    > navigate through rows of data returned from a database query? Is there a
    > better way?
    >
    > Thanks for any direction.
    >
    Eliyahu Goldin, Dec 17, 2006
    #2
    1. Advertising

  3. Don Miller

    Don Miller Guest

    Thanks. I forgot entirely about integer indexes.

    I appreciate your comments about the difference between the two platforms.
    What I have found so far for HTML tables with ASP.NET they are "simply"
    grids with one row representing one row of data albeit with ability to have
    hyperlinks, formatting, etc.. My HTML tables may have several display lines
    ("rows") for just one row of data, that flex to two or three columns per
    page of "rows" that are several display lines, all sorted by groups. I just
    have not seen anything created with ASP.NET that comes even close.

    I would love to see examples of how to do similar things with .NET
    (something like below). Thanks again

    (Typical .NET GridView)
    Column 1 Header Column 2 Header Column 3
    Row1Column1Data Row1Column2Data Row1Column3Data
    Row2Column1Data Row2Column2Data Row2Column3Data
    Row3Column1Data Row3Column2Data Row3Column3Data

    (what I need)
    Custom Header1 Custom Header3
    Row1Column1Data Row3Column1Data
    Row1Column2Data Row3Column2Data
    Row1Column3Data Row3Column2Data

    Custom Header2
    Row2Column1Data
    Row2Column2Data
    Row2Column3Data


    "Eliyahu Goldin" <> wrote in
    message news:...
    > To answer your question, a Dataset contains a collection of DataTables. A
    > DataTable contains a collection of Rows. You can use just an integer index
    > to navigate through it.
    >
    > Generally speaking, asp.net is object-oriented, not procedure-oriented.
    > Several server controls, such as repeater, datalist and gridview, can
    > produces a databound html table with item (row) structure of any
    > complexity. Trying using asp.net in the classic asp way won't be
    > productive and will be always annoying you. Something like driving an
    > airplane instead of flying it.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    >
    >
    > "Don Miller" <> wrote in message
    > news:O$...
    >> In my migration from ASP to ASP.NET 2.0, I have a fair number of
    >> complicated HTML tables that defy anything .NET can do. Using classic ASP
    >> I created these tables (by string concatenation) by moving forward, and
    >> at times, backward through a recordset (using a static cursor rather than
    >> a forward-only cursor).
    >>
    >> I can't seem to find any methods in .NET to move to a previous row in a
    >> Dataset (e.g. MovePrev, MoveFirst). Am I trying to use the wrong object
    >> to navigate through rows of data returned from a database query? Is there
    >> a better way?
    >>
    >> Thanks for any direction.
    >>

    >
    >
    Don Miller, Dec 17, 2006
    #3
  4. Datalist is capable of arranging several items in a row. You can make an
    item template containing a table with one column and 3 rows and databind the
    cell in the first row to column 1 etc. The item template can also include an
    html for the header, also databound if needed. In this way arrangement
    Item1 Item2
    Item3
    is implemented with no problems.

    For arrangement
    Item1 Item3
    Item2
    you would probably need to re-order the rows in the dataset to bring it to
    the first case.

    Even if you don't want to use item templates, you can build an html table
    dynamically out of server html controls for table, row and cell. It would be
    still better than concatenating html elements to a string.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "Don Miller" <> wrote in message
    news:...
    > Thanks. I forgot entirely about integer indexes.
    >
    > I appreciate your comments about the difference between the two platforms.
    > What I have found so far for HTML tables with ASP.NET they are "simply"
    > grids with one row representing one row of data albeit with ability to

    have
    > hyperlinks, formatting, etc.. My HTML tables may have several display

    lines
    > ("rows") for just one row of data, that flex to two or three columns per
    > page of "rows" that are several display lines, all sorted by groups. I

    just
    > have not seen anything created with ASP.NET that comes even close.
    >
    > I would love to see examples of how to do similar things with .NET
    > (something like below). Thanks again
    >
    > (Typical .NET GridView)
    > Column 1 Header Column 2 Header Column 3
    > Row1Column1Data Row1Column2Data Row1Column3Data
    > Row2Column1Data Row2Column2Data Row2Column3Data
    > Row3Column1Data Row3Column2Data Row3Column3Data
    >
    > (what I need)
    > Custom Header1 Custom Header3
    > Row1Column1Data Row3Column1Data
    > Row1Column2Data Row3Column2Data
    > Row1Column3Data Row3Column2Data
    >
    > Custom Header2
    > Row2Column1Data
    > Row2Column2Data
    > Row2Column3Data
    >
    >
    > "Eliyahu Goldin" <> wrote in
    > message news:...
    > > To answer your question, a Dataset contains a collection of DataTables.

    A
    > > DataTable contains a collection of Rows. You can use just an integer

    index
    > > to navigate through it.
    > >
    > > Generally speaking, asp.net is object-oriented, not procedure-oriented.
    > > Several server controls, such as repeater, datalist and gridview, can
    > > produces a databound html table with item (row) structure of any
    > > complexity. Trying using asp.net in the classic asp way won't be
    > > productive and will be always annoying you. Something like driving an
    > > airplane instead of flying it.
    > >
    > > --
    > > Eliyahu Goldin,
    > > Software Developer & Consultant
    > > Microsoft MVP [ASP.NET]
    > >
    > >
    > > "Don Miller" <> wrote in message
    > > news:O$...
    > >> In my migration from ASP to ASP.NET 2.0, I have a fair number of
    > >> complicated HTML tables that defy anything .NET can do. Using classic

    ASP
    > >> I created these tables (by string concatenation) by moving forward, and
    > >> at times, backward through a recordset (using a static cursor rather

    than
    > >> a forward-only cursor).
    > >>
    > >> I can't seem to find any methods in .NET to move to a previous row in a
    > >> Dataset (e.g. MovePrev, MoveFirst). Am I trying to use the wrong object
    > >> to navigate through rows of data returned from a database query? Is

    there
    > >> a better way?
    > >>
    > >> Thanks for any direction.
    > >>

    > >
    > >

    >
    >
    Eliyahu Goldin, Dec 17, 2006
    #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. news.microsoft.com
    Replies:
    0
    Views:
    415
    news.microsoft.com
    Apr 12, 2006
  2. Francisco Garcia
    Replies:
    2
    Views:
    455
    Fran Garcia
    Apr 13, 2006
  3. news.microsoft.com
    Replies:
    0
    Views:
    177
    news.microsoft.com
    Apr 12, 2006
  4. Francisco Garcia
    Replies:
    3
    Views:
    235
    vincent
    Apr 13, 2006
  5. Boni Satani
    Replies:
    0
    Views:
    141
    Boni Satani
    Jan 9, 2014
Loading...

Share This Page