Fasr retreival of data from .sdf file using SQL CE

A

anujithsankar

Hi,

I am trying to develope a Pocket PC application using MS Visual
Studio 2005 (C#)and the database is in the device (.sdf file).

Am trying to retreive a single row from a table containing around
10000 rows. I would like to know the fastest method to retreive the
values.

whether it is faster to use an SQLDataAdapter to retreive the values
to a dataset or datatable OR retreive the values to a SQLCEResultSet
OR is there any other faster retreival method.

Please advice

Thanks,

Anujith
 
D

David caso

datareader, always is more faster than dataset

(e-mail address removed) escribió:
 
K

Kay-Christian Wessel

Indexing the column(s) you are searching for will make a big difference on
performance.

It is also important where on your device you store the SDF file. Some
memory is fast other is slow. Testing this is important.

Since stored procedures are not allowed on the SDT database, I guess the
fastest way would be to use a T-SQL query and read it using the reader for
SQLCe.

Kay
 
G

Ginny Caughey [MVP]

In some low-memory situations, using TableDirect and specifying a range is
very much faster than using SQL syntax. SqlCeDataReader and SqlCeResultSet
(which inherits from SqlceDataReader) are faster than SqlCeDataAdapter.
Finding a single row using an index on the unique value you're seeking from
a table with 10000 rows should be nearly instantaeous using TableDirect and
SqlCeDataReader/ResultSet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top