I am working on writing a high-performance data retrieval/storage class for my application that uses a SqlDataReader to retrieve data from a SQL server.
Out of curiosity, I wanted to know what form the data comes in from the SQL server. Characters? Binary? Some other form?
Unfortunately I cannot do any packet sniffing at my office, which is one way I think this answer could be found.
EDIT: The purpose of this question was to determine the format the data is retrieved in from SQL server to allow for as little manipulation as possible before placing it in a data structure.
This question is in relation to a previous question of mine where I found the difference between converting data formats into strings produces a significant impact on performance.
The format is documented at Tabular Data Stream Protocol Specification. That being said, the protocol and wire format are largely irrelevant, if you retrieve so much data as to for the speed of transfer to matter you are already deep down the wrong path.
Make sure your data access is optimized, and most importantly your data model is well designed and matches the workload expected (in other words: have covering indexes for the critical queries).
If you retrieve large chunks of data (eg. media files stored in the database) then there are some specific ways to use the
SqlCommandclass, namely theSequentialAccessbehavior flag:For an example of how to use this, see Download and Upload images from SQL Server via ASP.Net MVC.