J
Jon Brunson
Hi,
I'm working on a CF.NET project that uses SqlCe extensively, and at the
moment database access is very slow. So I would appreciate your opinions
and ideas for improving the performance.
Currently I'm using DataAdapters to .Fill() a DataTable (NOT DataSet),
and returning either the first DataRow (if I only want 1 record), or all
of the rows in the returned table, from the database tier to the
business logic. Now I know .Fill() is slow, but how can I improve on
that by doing stuff myself?
I few of my ideas follow:
1) Use a DataReader to populate a HashTable (or a Collection of) and
return that/those to the business logic
2) Use a DataReader to get the data, and create a DataTable using the
DataReader's .GetSchemaTable() method, then add each row from the
DataReader manually (I think this is pretty much what DataAdapter.Fill()
does anyway)
3) Keep using DataAdapter.Fill(), but do something magical that I don't
know of to make it quicker.
Please bare in mind I can't return the DataReader directly, as most of
the time I need more than one open at a time (and as it's SqlCe, I can
only have 1 connection open to the database)
I'm working on a CF.NET project that uses SqlCe extensively, and at the
moment database access is very slow. So I would appreciate your opinions
and ideas for improving the performance.
Currently I'm using DataAdapters to .Fill() a DataTable (NOT DataSet),
and returning either the first DataRow (if I only want 1 record), or all
of the rows in the returned table, from the database tier to the
business logic. Now I know .Fill() is slow, but how can I improve on
that by doing stuff myself?
I few of my ideas follow:
1) Use a DataReader to populate a HashTable (or a Collection of) and
return that/those to the business logic
2) Use a DataReader to get the data, and create a DataTable using the
DataReader's .GetSchemaTable() method, then add each row from the
DataReader manually (I think this is pretty much what DataAdapter.Fill()
does anyway)
3) Keep using DataAdapter.Fill(), but do something magical that I don't
know of to make it quicker.
Please bare in mind I can't return the DataReader directly, as most of
the time I need more than one open at a time (and as it's SqlCe, I can
only have 1 connection open to the database)