DataSets or Datareaders?!?!

  • Thread starter Thread starter Miguel Pais
  • Start date Start date
M

Miguel Pais

Hello

Imagine you've an web page made by an ASP.NET web service
and the asp.net page itself.

All the Data retriving that the application does is made
using the webservice... when a web form is loaded the web
page calls several functions of the web service to get
the options to populate drop down boxes etc...

so far i've been using datasets returned from the web
service to the page.
example: in a form on dropdown box could have a list of
clients. In the web page, on form load, i invoke a
webmethod of my web service that returns a dataset to the
page with a table consisting of those records fetched. In
the page
I run over all the rows of the tablçe and populate the
dropdown box.

my doubt is: am i using ado.net right to do such things
or should
i return a datareader for the web page instead of a
dataset?!?!
is it good practice to works as i've been doing?!?!
its' not a waste of resources to have things done that
way?!?!

best regards

Miguel Pais
 
You mean not return a datareader from a web service - this object is not
serializable,

What would be faster is to return XML from the web service, and bind your
data to the XML.

Hello

Imagine you've an web page made by an ASP.NET web service
and the asp.net page itself.

All the Data retriving that the application does is made
using the webservice... when a web form is loaded the web
page calls several functions of the web service to get
the options to populate drop down boxes etc...

so far i've been using datasets returned from the web
service to the page.
example: in a form on dropdown box could have a list of
clients. In the web page, on form load, i invoke a
webmethod of my web service that returns a dataset to the
page with a table consisting of those records fetched. In
the page
I run over all the rows of the tablçe and populate the
dropdown box.

my doubt is: am i using ado.net right to do such things
or should
i return a datareader for the web page instead of a
dataset?!?!
is it good practice to works as i've been doing?!?!
its' not a waste of resources to have things done that
way?!?!

best regards

Miguel Pais
 
Back
Top