473,699 Members | 2,877 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 1379
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
3044
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
2359
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
3261
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
2076
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
2360
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
2930
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
9037
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
1308
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
2527
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
8704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
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
9054
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
8895
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...
0
7781
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
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
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2015
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.