How to efficiently write to file from SQL datareader in c#?
问题 I have a remote sql connection in C# that needs to execute a query and save its results to the users's local hard disk. There is a fairly large amount of data this thing can return, so need to think of an efficient way of storing it. I've read before that first putting the whole result into memory and then writing it is not a good idea, so if someone could help, would be great! I am currently storing the sql result data into a DataTable, although I am thinking it could be better doing