The fastest way to read data from MySQL using C #

I am wondering if there is a faster method than using something like:

while (Reader.Read()) 

to read mysql select query results.

I accidentally pull 10,000 rows from a database and would like to read this as quickly as possible. Is there a way to serialize the results if we know what they are (for example, using metadata to set up the structure)?

+6
c # mysql
source share
1 answer

Try the MySQLDataAdapter.Fill method to fill any DataTable object - the reading speed is comparable to the optimal use of the read data using the Read method (depends on your way of reading blocks), and the main advantage is that you get a ready-made data collection that you can control or just write to the xml file.

+5
source share

All Articles