473,748 Members | 2,563 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How SqlDataReader Works underneath

2 New Member
Hello ,my question is theoretical.
When i make a request from the client(my PC) to the Server(SqlServe r),the data are sent back in packets.In my connection string i wrote:
Packet Size = 512, which means that each packet(Result Set) will be equal to that.Plus my SqlServer and application are in the same box which means that the buffer is a shared memory in my PC.
I execute this simple code :

Expand|Select|Wrap|Line Numbers
  1. con.open();
  2. SqlDataReader rdr= command.ExecuteReader();
  3. MyDataTable.Load(rdr);
  4. con.close();
Then in debugging mode, i put a breakpoint to MyDataTable.Loa d(rdr);
Now,if i hover my mouse over the rdr object, i m able to see all data from SqlServer in Result Views of the drop down list, which it s strange.
I would expect only the first result set to see.
Each datarow in SqlServer is about 50 bytes, so a Result Set would normally contain about 10-11 datarows. So, how am i able to see 2300 datarows ?
Even if i scroll down to result number 1000, which means that definitely i am not in the first Result Set, i am able to go back and read my first DataRow.But since the SqlDataReader is not supposed to keep in memory
all the results, how am i able to see all the results ?
What am i missing here?
Sep 18 '13 #1
1 1381
Rabbit
12,516 Recognized Expert Moderator MVP
The packets being sent are 512 bytes in size. But all packets must be sent before it moves from line 2 to line 3. It's not like there's a loop between line 2 and 3 that processes one packet and then jumps back to line 2.
Sep 18 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3049
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove event to keep the ghost image under the mouse pointer. There are three problems: (1) if the ghost image is dragged so it is partially off the edge of the screen, scrollbars appear. This not only looks bad, it can cause the page to autoscroll...
7
2362
by: Franck Diastein | last post by:
Hi, when I call ExportData I have this error: Invalid attempt to Read when reader is closed. Telling me that there's a problem with this line: while(_dataR.Read()){ Code: ************************************************* public void Export2CSV(){
1
3265
by: Arvind P Rangan | last post by:
Hi All, How do you get all the values of a sqldatareader if it contains multiple resultset. Using sqldatareader.nextresult and sqldatareader.read e.g. While sqldatareader.read ' If not sqldatareader then sqldatareader.nextresult
8
2082
by: bidllc | last post by:
I have a funtion that works fine and dandy when called from anywhere in my app. It will NOT work when called from inside the class in which it resides. This is the function I'm calling: "getProductByID(productID)" from inside another method in the same class. See below. This line throws a null ref exception: While dr.Read() Thanks for any insight!
4
2364
by: mimi | last post by:
Hi Please help me out, I can't find a way to close a sqldatareader when error occur at statement cmd.ExecuteReader(). I can't close it in catch because it is local in try scope and I can't declare it outside try scope either since we have to call cmd.executeReader to create sqldatareader public string GetLogs(int logID) {
2
2931
by: Cameron Frasnelly | last post by:
I emulated the code from the .Net Framework help (Titled "Using Stored Procedures with a Command") and I still receive and error... Error Received = "Invalid attempt to read when no data is present." BUT when I manually run the Stored Procedure and manually type in '3333' it works just fine by returning the single row for that particular work order???????? *****More Clues****
6
9040
by: James P. | last post by:
I'm trying to pass a sqlDataReader from a called function to a calling function but got nothing back and a message saying "An unhandled exception of type 'System.NullReferenceException' occurred in Throw.exe. Object reference not set to an instance of an object." Here is my code: Public Function testint() As String 'Nothing returns here, plus the error above Dim xp As SqlDataReader = getStoreProcedures("StoreProcedure") End Function
4
1310
by: paapa21 | last post by:
I want to Declear a variable as SqlDataReader in ASP 2.0. But when i do so it tells me SqlDataReader is not define. This same code works in my previous application in ASP 1.0. Has this change? Can someone show me how to do this. Below is the function and the line of the error is bold. Function GetUniversity() As String Dim Unipayment As New UnipaymentDB Dim CIDR As SqlDataReader = Unipayment.StudentState(Request.Params("StudentID"))
4
2529
by: Learner | last post by:
Hello, This my a method to call a stored proce and uses a DataReader to read the data in the below method I am trying to assign a null value to my datareader variable Dim datareader As SqlDataReader datareader = null but it doesn't accept.
1
3011
by: mastershake | last post by:
I'm trying to make some c#. I have a sqldatareader to get the logical file names from *.BAK files. It works on the default instance but if I add a named instance it fails. It gives me this: System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) I don't get this error on the...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.