473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Accessing multiple values

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?

Feb 12 '07 #1
2 1028
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!
********************************************
"Paul" <Ge**********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
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?
Feb 12 '07 #2

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.


"Paul" <Ge**********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
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?

Feb 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next...
1
by: Vivek Sharma | last post by:
Hi, I am using a listbox in a web user control with selection mode as "Multiple". I am not sure how can I access the multiple selected values in my aspx form. Please help. THanks
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
1
by: reshmaah | last post by:
hello, i would like to access values selected by user on form, from multiple list,i mean, from field <select multiple name=color> how can i acheive it.
2
by: Dahak | last post by:
It seems that my GoogleFu has failed me tonight and I'm hoping I can find some advice. I've inherited a ASP.NET project written in Visual Basic. I'm not too familiar with the .NET framework...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.