469,609 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Display data with ASP.NET

With other solutions I would get a recordset, read each record and
display data by formating my html as I wanted to display values of
each record. I am trying to display data in a three column three row
table with paging. How does this translate to ASP.NET - or - what
ASP.NET tools do I use to accomplish this and how.

Thank you.

Apr 20 '07 #1
4 1832
<se*********@yahoo.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
With other solutions I would get a recordset, read each record and
display data by formating my html as I wanted to display values of
each record. I am trying to display data in a three column three row
table with paging. How does this translate to ASP.NET - or - what
ASP.NET tools do I use to accomplish this and how.
There's nothing to stop you doing exactly this in ASP.NET if you want to...
The only difference is that ASP.NET uses ADO.NET natively (since it's part
of the Framework), not ADO...

The ADO.NET equivalent of an ADO Recordset is (more or less) the DataSet
object. It has a collection of tables, and each table has a collection of
rows etc...

However, ASP.NET has databound controls e.g. <asp:GridViewwhich accept an
ADO.NET object such as a DataSet as their DataSource property - this means
that most of the ASP Classic "donkey work" is removed.

Do a Google search for ASP.NET DataSet <asp:GridView>
Apr 20 '07 #2

#1 Rule with Asp.Net

DO NOT LOOP OVER RECORDS TO CREATE HTML.

Here is a decent place to start.

http://www.asp101.com/samples/database_aspx.asp
Notice the use of
..DataSource = (some object)
..DataBind()
DO NOT LOOP OVER ITEMS AND CREATE HTML.
I would look at the
asp:repeater control.

<se*********@yahoo.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
With other solutions I would get a recordset, read each record and
display data by formating my html as I wanted to display values of
each record. I am trying to display data in a three column three row
table with paging. How does this translate to ASP.NET - or - what
ASP.NET tools do I use to accomplish this and how.

Thank you.

Apr 20 '07 #3
Thank you for the helpful response.

OK - I like the fact that <asp:GridViewmakes life easier with
things like "AllowPaging = "True"" and "AllowSorting = "True"".

But I still am not sure how to control the display of my data.
Example: I want to use a the value of my ProductID field to build an
image URL and display it in a <tr><td></td></tr>. Then in a new row I
want to use the value of my ProductDescription field to display text,
and etc ...

It appears that <asp:GridViewdisplays all field data returned from
the query and displays it in a simple table view. Am I missing
something?

Should I be using another asp construct for my purpose?
On Apr 20, 10:10 am, "Mark Rae" <m...@markNOSPAMrae.netwrote:
<seth_hic...@yahoo.comwrote in message

news:11*********************@y5g2000hsa.googlegrou ps.com...
With other solutions I would get a recordset, read each record and
display data by formating my html as I wanted to display values of
each record. I am trying to display data in a three column three row
table with paging. How does this translate to ASP.NET - or - what
ASP.NET tools do I use to accomplish this and how.

There's nothing to stop you doing exactly this in ASP.NET if you want to...
The only difference is that ASP.NET uses ADO.NET natively (since it's part
of the Framework), not ADO...

The ADO.NET equivalent of an ADO Recordset is (more or less) the DataSet
object. It has a collection of tables, and each table has a collection of
rows etc...

However, ASP.NET has databound controls e.g. <asp:GridViewwhich accept an
ADO.NET object such as a DataSet as their DataSource property - this means
that most of the ASP Classic "donkey work" is removed.

Do a Google search for ASP.NET DataSet <asp:GridView>

Apr 20 '07 #4
I should also mention that I am trying to create a page with three
rows of three table cells each.

On Apr 20, 4:34 pm, seth_hic...@yahoo.com wrote:
Thank you for the helpful response.

OK - I like the fact that <asp:GridViewmakes life easier with
things like "AllowPaging = "True"" and "AllowSorting = "True"".

But I still am not sure how to control the display of my data.
Example: I want to use a the value of my ProductID field to build an
image URL and display it in a <tr><td></td></tr>. Then in a new row I
want to use the value of my ProductDescription field to display text,
and etc ...

It appears that <asp:GridViewdisplays all field data returned from
the query and displays it in a simple table view. Am I missing
something?

Should I be using another asp construct for my purpose?

On Apr 20, 10:10 am, "Mark Rae" <m...@markNOSPAMrae.netwrote:
<seth_hic...@yahoo.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
With other solutions I would get a recordset, read each record and
display data by formating my html as I wanted to display values of
each record. I am trying to display data in a three column three row
table with paging. How does this translate to ASP.NET - or - what
ASP.NET tools do I use to accomplish this and how.
There's nothing to stop you doing exactly this in ASP.NET if you want to...
The only difference is that ASP.NET uses ADO.NET natively (since it's part
of the Framework), not ADO...
The ADO.NET equivalent of an ADO Recordset is (more or less) the DataSet
object. It has a collection of tables, and each table has a collection of
rows etc...
However, ASP.NET has databound controls e.g. <asp:GridViewwhich accept an
ADO.NET object such as a DataSet as their DataSource property - this means
that most of the ASP Classic "donkey work" is removed.
Do a Google search for ASP.NET DataSet <asp:GridView>- Hide quoted text -

- Show quoted text -

Apr 20 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kay | last post: by
19 posts views Thread by dmiller23462 | last post: by
7 posts views Thread by Stefan Finzel | last post: by
1 post views Thread by Eric Keung | last post: by
18 posts views Thread by Terry Holland | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.