Solved

Speed of SqlDataReader vs SqlDataAdapter/DataSet

Posted on 2006-06-15
4
987 Views
Last Modified: 2008-02-01
Has anyone done research/testing on using SqlDataReader vs SqlDataReader in C++.net?  I am just curious. I wrote code in C++.net thinking it would be faster than vb.net code. My testing shows that vb.net is just as fast for grabbing data from sql, doing a bit of math and updating sql. I thought it would be faster in C++.net, but it is managed code. I am using SQLDataReader in C++.
Thanks for any input!
Pam
0
Comment
Question by:pamwestphal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 63 total points
ID: 16914158
They should both be the same as they will, for the most part, compile to precisely the same IL code.

Unmanaged C++ should be faster than equivalent .Net code, but there shouldn't be much difference (if any) in speed for managed languages.
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 62 total points
ID: 16937160
Without doing any actual research, I can opine that the throughput bottleneck is nearly always the database access itself, rather than the code that wraps that access.  If you write "to the metal" -- direct access to the database drivers you might see a few % speed increase.  Otherwise, the performance will be very similar.

Anything that DOT NET does (or ADO or ODBC layer does) will burn a few CPU cycles, but the bulk of the data access time will be time spent by the DBMS driver in table scans to filter the recordset and to satisfy the SELECT statement and in I/O time spent transfering that data to your program.

Such things as a well-thought-out indexing strategy and selective record fetching will make much more difference in the overall speed of your database-intensive program than the specific tool you use to access the database.

-- Dan
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question