Regarding a small confusion about DataReader

2020-07-29 09:03发布

问题:

I was reading about DataReader and found a statement about DataReader which is not clear. here it is

DataReader fetches the records from database and stores in the network buffer and gives whenever requests. It releases the records as query executes and do not wait for the entire query to execute. Hence very fast as compare to the DataSet which releases the data after loading all the data in memory.

1) it says that DataReader fetches the records from database and stores in the network buffer? i really do not understand what is network buffer? can anyone tell me what does it mean network buffer?

回答1:

See this MSDN article. The network buffer is in-memory storage on the client that will hold a certain amount of data which is generally smaller that the entire dataset. As data is read from the buffer, it will be re-filled with more data from the database.