How does fetching data from SQL Server to SqlDataReader work?

为君一笑 提交于 2019-11-30 04:51:52

the data is streamed from sql server to the client in the packets of the size in SqlConnection.PacketSize property. If your client can't read results fast enough the buffer on the network card gets filled up, the protocol detects this and stops receiving which in turn makes sql server's network card send buffer full and it stops sending any and all data. if you want to go down to the protocl level then check out TDS protcol.

I believe the exact details of the network communications are dependent on a lot of things outside of your code sample, in part because of the SQL Server Connection Pooling, but I think you're looking for the SqlConnection.PacketSize property (MSDN).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!