473,326 Members | 2,111 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,326 software developers and data experts.

DataReaders - networking problems or benefits?

If I am grabbing a lot of rows (say 10,000 from SQL) would I be helping

or hurting the network by using a DataReader? I would think helping
because it's really only returning 1 row at a time, but I'm not sure.
Are there good articles out there that explain how the DataReader does
this as well as any that discuss performance problems/benefits?

Nov 7 '06 #1
10 1751
Well, the nature of the connection means that it is (via most routes) only
/returning/ 1 row at a time - it is just that DataTable etc build them all
into a single mass before completing. Most of the overhead here is on the
client, not the network or server. Arguably, you could say that since the
DataTable approach uses more resources, it is likely to be a little slower,
and so pester the server for longer. The network probably won't mind either
way as long as the same number of trips and records are involved.

Perhaps a better question is: can you avoid bringing it over the network at
all? Can you aggregate etc at the server, reduce the columns (don't use "*")
/ rows ("WHERE") fetched, things like that...

Marc
Nov 7 '06 #2
DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.

On Nov 7, 11:11 am, "Doug" <dnlwh...@dtgnet.comwrote:
If I am grabbing a lot of rows (say 10,000 from SQL) would I be helping

or hurting the network by using a DataReader? I would think helping
because it's really only returning 1 row at a time, but I'm not sure.
Are there good articles out there that explain how the DataReader does
this as well as any that discuss performance problems/benefits?
Nov 7 '06 #3
Hi Doug,

As opposed to what other mechanism?

DataReader is used internally by DataAdapter, so I really don't see any other
fully-managed choice but to directly or indirectly use a DataReader.

Also, the latency depends on the amount of data in each row. If each of the
10000 rows are reasonably small in size the operation should be quick on a
LAN. Figure that if each row has a maximum size of 100 B then the total size
of the 10000 rows of data won't exceed 1 MB (+ protocol control bits). On a
10Mb/s LAN the total latency would be ~1 second.

I agree with Marc that your choice of queried data is probably more important
than how you get it into your application. After all, decreasing the size of
a returned row, 10000 times, is going to help out more than switching the
mechanism that downloads them.

If you are still seeing performance problems, then mock up a program to
compare the performance with a DataReader vs. a DataReader used by a
DataAdapter vs. any other mechanism you have in mind. Choose the quickest of
them all :)

--
Dave Sexton

"Doug" <dn******@dtgnet.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
If I am grabbing a lot of rows (say 10,000 from SQL) would I be helping

or hurting the network by using a DataReader? I would think helping
because it's really only returning 1 row at a time, but I'm not sure.
Are there good articles out there that explain how the DataReader does
this as well as any that discuss performance problems/benefits?

Nov 7 '06 #4
DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.
Is there any difference between the two as far as how much data is sent
over the network at one time?

Nov 7 '06 #5
Hi Doug,

DataSets and DataTables don't use DataReaders. They are objects that hold
data in-memory.

--
Dave Sexton

"Doug" <dn******@dtgnet.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>
>DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.

Is there any difference between the two as far as how much data is sent
over the network at one time?

Nov 7 '06 #6
Doug wrote:
If I am grabbing a lot of rows (say 10,000 from SQL) would I be helping
or hurting the network by using a DataReader? I would think helping
because it's really only returning 1 row at a time, but I'm not sure.
1) Network usage is the same for both DataAdapter and DataReader (like
Dave said DataAdapter use DataReader)
Are there good articles out there that explain how the DataReader does
this as well as any that discuss performance problems/benefits?
2) Difference in usage of that data. If you want to display rows in
datagrid then use DataAdapter+DataTables (10k rows in one datagrid not
very useful for user, so paging may help). If you want to dump data to
file or smth like that - DataReader is preferred choice because you
don't have all 10k rows in memory at the same time.

look at part IV here:
http://download.microsoft.com/downlo...0/ScaleNet.pdf

Nov 7 '06 #7

Yury wrote:
>
look at part IV here:
http://download.microsoft.com/downlo...0/ScaleNet.pdf
sorry, Part III, Chapter 12 is yours %). But all parts of this paper is
very useful ;-).

Nov 7 '06 #8
Correct, but they are populated using TableAdapters, which use DataReaders
internally.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:Ok**************@TK2MSFTNGP04.phx.gbl...
Hi Doug,

DataSets and DataTables don't use DataReaders. They are objects that hold
data in-memory.

--
Dave Sexton

"Doug" <dn******@dtgnet.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>>
>>DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.

Is there any difference between the two as far as how much data is sent
over the network at one time?


Nov 7 '06 #9
Correction, I mean DataAdapters.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:Ok**************@TK2MSFTNGP04.phx.gbl...
Hi Doug,

DataSets and DataTables don't use DataReaders. They are objects that hold
data in-memory.

--
Dave Sexton

"Doug" <dn******@dtgnet.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>>
>>DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.

Is there any difference between the two as far as how much data is sent
over the network at one time?


Nov 7 '06 #10
Right, and I mentioned that already in another post in this thread.

--
Dave Sexton

"Kevin Spencer" <sp**@uce.govwrote in message
news:OM*************@TK2MSFTNGP03.phx.gbl...
Correction, I mean DataAdapters.

--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

I just flew in from Chicago with
a man with a wooden leg named Smith
who shot an elephant in my pajamas.
So I bit him.
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:Ok**************@TK2MSFTNGP04.phx.gbl...
>Hi Doug,

DataSets and DataTables don't use DataReaders. They are objects that hold
data in-memory.

--
Dave Sexton

"Doug" <dn******@dtgnet.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
>>>
DataSets (DataTables) use a DataReader under the covers any way so it
is the same result.

Is there any difference between the two as far as how much data is sent
over the network at one time?



Nov 8 '06 #11

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

Similar topics

0
by: Tony Murphy | last post by:
folks, can someone point me to a good website on java networking trouble shooting and windows nt (hate it btw) socket diagnostic help (netstat, tracert blah,.....) thanks
46
by: H.A. Sujith | last post by:
Why doesn't the standard library provide (at least basic) networking facilities using TCP/IP ?
6
by: Ravikanth[MVP] | last post by:
Hi Alternative is check before assigning as TextBox value. TextBox1.Text =myRow==DBNull.Value)?"": (string)myRow HTH Ravikanth
7
by: Guadala Harry | last post by:
I'm trying to design all of my data access logic into one centralized assembly. I'm wondering how to implement DataReaders. There's plenty of documentation on passing DataSets to the client from...
5
by: Ryan Ternier | last post by:
I know how this should be done in regards to nTier, but it seems a bit inneficient, and was wondering if there's a solution that I havn't thought of yet. (I'm switching this loop to For Each Row...
4
prometheuzz
by: prometheuzz | last post by:
Hello all, There's this problem I have, which I am unable to find a solution for. The problem is this: I cannot post messages with a specific size on (certain) forums. I hear you thinking: what...
5
by: Nefrit | last post by:
Ok, I can't figure it out, please someone else help if you know what to do. I have a Linksys Wireless G Router and Wireless G USB network adapter. My host computer is using Windows XP and there is no...
0
by: RigasMinho | last post by:
Description Company Description: Our client company is looking for very talented PHP engineers who can program without using any external tools. The company is a social networking company with...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.