Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid question

Reply
Thread Tools

Datagrid question

 
 
C Downey
Guest
Posts: n/a
 
      04-15-2004
I have a web page that I displays the search results from another form. The
way I have it developed right now, my data access layer returns me the
results as an array (first name, lastname, id). When the results are
returned I want to display them in a table that allows paging if too many
results are returned.

One way of displaying my results is to have my data access object return me
a dataset and bind the dataset to a datagrid in my aspx page. There is the
potential for up to a hundred records (I cap it at 100) being returned,
which is relatively few records, however this page will take a lot of hits.
Is it bad practice to return a dataset from a DAL to the aspx page?

Other wise I will probably end up returning an array with the information
and loop through it to manually write out my table of results (but this does
not allow paging and I would prefer not to have to code that by hand)

Since displaying data is such a common thing, I am wondering what do you
guys do to display data and how do you return your data to your aspx page
from you data access layer.

TIA
-c


 
Reply With Quote
 
 
 
 
Charlie@CBFC
Guest
Posts: n/a
 
      04-15-2004
Create a SQL or OLEDb connection to your datasource and return a reader or
table in a dataset object. Then bind to grid by calling its databind()
method. By default, the grid will generate columns. You can customize grid
using template columns.



"C Downey" <(E-Mail Removed)> wrote in message
news:e$(E-Mail Removed)...
> I have a web page that I displays the search results from another form.

The
> way I have it developed right now, my data access layer returns me the
> results as an array (first name, lastname, id). When the results are
> returned I want to display them in a table that allows paging if too many
> results are returned.
>
> One way of displaying my results is to have my data access object return

me
> a dataset and bind the dataset to a datagrid in my aspx page. There is

the
> potential for up to a hundred records (I cap it at 100) being returned,
> which is relatively few records, however this page will take a lot of

hits.
> Is it bad practice to return a dataset from a DAL to the aspx page?
>
> Other wise I will probably end up returning an array with the information
> and loop through it to manually write out my table of results (but this

does
> not allow paging and I would prefer not to have to code that by hand)
>
> Since displaying data is such a common thing, I am wondering what do you
> guys do to display data and how do you return your data to your aspx page
> from you data access layer.
>
> TIA
> -c
>
>



 
Reply With Quote
 
 
 
 
Rick Spiewak
Guest
Posts: n/a
 
      04-23-2004
You should be fine returning a dataset. But, you can bind directly to an
arraylist, or even a collection of custom objects where the collection
object inherits system.collections.collectionbase. You can bind directly to
the properties of the objects which make up the collection. This might be a
useful approach as well.

"C Downey" <(E-Mail Removed)> wrote in message
news:e$(E-Mail Removed)...
> I have a web page that I displays the search results from another form.

The
> way I have it developed right now, my data access layer returns me the
> results as an array (first name, lastname, id). When the results are
> returned I want to display them in a table that allows paging if too many
> results are returned.
>
> One way of displaying my results is to have my data access object return

me
> a dataset and bind the dataset to a datagrid in my aspx page. There is

the
> potential for up to a hundred records (I cap it at 100) being returned,
> which is relatively few records, however this page will take a lot of

hits.
> Is it bad practice to return a dataset from a DAL to the aspx page?
>
> Other wise I will probably end up returning an array with the information
> and loop through it to manually write out my table of results (but this

does
> not allow paging and I would prefer not to have to code that by hand)
>
> Since displaying data is such a common thing, I am wondering what do you
> guys do to display data and how do you return your data to your aspx page
> from you data access layer.
>
> TIA
> -c
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Datagrid: how cut short display of a long description in a datagrid column Brian K. Williams ASP .Net 0 03-02-2004 08:35 PM
RE: Datagrid: how cut short display of a long description in a datagrid column =?Utf-8?B?U3VyZXNo?= ASP .Net 0 03-02-2004 08:31 PM
datagrid in datagrid BK Kim ASP .Net 1 03-02-2004 06:34 AM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments