Accessing multiple values

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi all,

I've written a custom DAL for a web app i'm currently working on, and
I am trying to make it as efficient as possible- where possible.
Objects are populated on creation using the DAL, currently I pull out
1 row of the db into a dataset, and assign the values to members of
the class - the class is then accessed from the presentation layer.
Would it be more efficient to use a datareader to pass the values into
a 'n'th length string array and use that to populate the class?
 
DataSets use a DataReader, so you would remove one step. It will make the
code a tiny bit more complex, but it will make it quite a bit faster not
creating and consuming the dataset.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
 
I do some time tests here:

But using an IDataReader to populate objects is usually your best bet.


http://sholliday.spaces.live.com/blog/


6/5/2006
Custom Objects and Tiered Development II // 2.0


5/24/2006
Custom Objects/Collections and Tiered Development


Make sure you seperate your objects.... from the (other) object which
creates them.


The absolute fastest for a SINGLE row, is to use output parameters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top