By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,156 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

ASP Migration - Moving Through DataSets

P: n/a
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.
Dec 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <no****@nospam.comwrote in message
news:O$**************@TK2MSFTNGP02.phx.gbl...
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.

Dec 17 '06 #2

P: n/a
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" <RE**************************@mMvVpPsS.orgwrote in
message news:ul**************@TK2MSFTNGP04.phx.gbl...
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" <no****@nospam.comwrote in message
news:O$**************@TK2MSFTNGP02.phx.gbl...
>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.


Dec 17 '06 #3

P: n/a
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" <no****@nospam.comwrote in message
news:el**************@TK2MSFTNGP04.phx.gbl...
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" <RE**************************@mMvVpPsS.orgwrote in
message news:ul**************@TK2MSFTNGP04.phx.gbl...
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" <no****@nospam.comwrote in message
news:O$**************@TK2MSFTNGP02.phx.gbl...
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.


Dec 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.