Hi together,

we are planning to use DataSets on our SQLite Database on Compact
Framework 2.0. I am quite new to ADO.NET and also the Wrapper from R.
Simpson for SQLite.

Can anyone tell me about the advantages and disadvantages of DataSets.
Some simple Code-Snippet ( in use of the wrapper) would I appreciate.

Thanks a lot
Daniel

Re: Dis-/Advantages with Datasets on SQLite by W

W
Tue Dec 20 09:36:54 CST 2005

Daniel - I'll gladly help but not sure i follow you on what you're looking
for. When you say the advantages/disadvantages, what is the baseline you
want to compare against? As far a using DataSets go, the whole architecture
is such that it doesn't really know or care where the data came from, it
could come from a web service, filling it programatically, a SqlMobile
database, a Oracle database or anything else. So once it's populated,
there's no difference between a dataset filled against SqlLite vs Oracle vs
SqlMobile vs Comma Separated files etc.. If you can let me know a little
more aobut what you're looking for, hopefully I can give you a more precise
answer.

HTH,
Bill
"Daniel" <danielsanberger@googlemail.com> wrote in message
news:1135071840.847134.312480@g47g2000cwa.googlegroups.com...
> Hi together,
>
> we are planning to use DataSets on our SQLite Database on Compact
> Framework 2.0. I am quite new to ADO.NET and also the Wrapper from R.
> Simpson for SQLite.
>
> Can anyone tell me about the advantages and disadvantages of DataSets.
> Some simple Code-Snippet ( in use of the wrapper) would I appreciate.
>
> Thanks a lot
> Daniel
>



Re: Dis-/Advantages with Datasets on SQLite by Simon

Simon
Tue Dec 20 09:42:52 CST 2005

There was a good article on this very subject a couple of weeks ago. Try
searching the newsgroup server for text : "portable databases".

Cheers
Simon.

"Daniel" <danielsanberger@googlemail.com> wrote in message
news:1135071840.847134.312480@g47g2000cwa.googlegroups.com...
> Hi together,
>
> we are planning to use DataSets on our SQLite Database on Compact
> Framework 2.0. I am quite new to ADO.NET and also the Wrapper from R.
> Simpson for SQLite.
>
> Can anyone tell me about the advantages and disadvantages of DataSets.
> Some simple Code-Snippet ( in use of the wrapper) would I appreciate.
>
> Thanks a lot
> Daniel
>



Re: Dis-/Advantages with Datasets on SQLite by Daniel

Daniel
Tue Dec 20 11:48:42 CST 2005

Hi Bill,

thanks for your help. Ok, more precise, I did setup a DbDataReader on
SQLite. My first question is, what is the advantage of a DataSet
compared to a DataReader. My second is, if there is a tutorial
available using a DataSet (at best with SQLite Wrapper!).

Daniel


Re: Dis-/Advantages with Datasets on SQLite by Chris

Chris
Tue Dec 20 12:27:00 CST 2005

SQLite has no bearing on the differences. A DataSet is a DataSet and a
DataReader is a DataReader. A DataSet is scrollable and updatable, but it's
got a large memory footprint and is slow. A DataReader is small and fast,
but is not scrollable nor updatable.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


"Daniel" <danielsanberger@googlemail.com> wrote in message
news:1135100921.943599.303970@g44g2000cwa.googlegroups.com...
> Hi Bill,
>
> thanks for your help. Ok, more precise, I did setup a DbDataReader on
> SQLite. My first question is, what is the advantage of a DataSet
> compared to a DataReader. My second is, if there is a tutorial
> available using a DataSet (at best with SQLite Wrapper!).
>
> Daniel
>



Re: Dis-/Advantages with Datasets on SQLite by Robert

Robert
Tue Dec 20 12:50:12 CST 2005

SQLite, being an ADO.NET wrapper, behaves pretty much exactly the way every
other ADO.NET provider behaves. Therefore it would be more precise and
beneficial to explain ADO.NET behavior rather than SQLite behavior.

A DataReader is what ADO.NET uses to populate a DataSet/DataTable. When you
use a DataAdapter and call the Fill() method, the DataAdapter is actually
opening up a DataReader and loading all of the columns and data into the
destination DataSet/DataTable.

The major differences between a DataReader and a DataSet are:

The DataReader is a stream, whereby you read one row from the stream and
then move to the next row. There is no concept of moving backwards or
randomly from one row to another. As someone else stated in the forums, a
DataReader is a firehose.

A DataSet is an in-memory grid-like structure that holds all the rows and
all the columns from a DataReader. Once the DataSet is filled up you can
dispose of the DataReader entirely and work with the contents of the DataSet
in an offline fashion.

Think of a DataSet as a bucket. You aim the firehose at the bucket and the
bucket collects all the water. You can then stick your cup in the bucket
and grab whatever amounts of water you want from anywhere in the bucket --
but the firehose has been turned off and put away and all you're left with
is the isolated bucket.

Any changes made to data in a DataSet are tracked. It becomes possible then
to use a DataAdapter to actually trigger UPDATE/INSERT/DELETE statements
that can synchronize the changes you've made back to the underlying
database.

The DataReader has no such capacity. It is read-only. If you want to
change data you have to generate your own UPDATE/INSERT/DELETE commands and
execute them.

As for performance ... all the convenient DataSet features that track
changes, raise events and store all the data come at a cost. DataSets are
memory hogs and are much slower than handmade code that iterates and updates
from a DataReader.

Robert




"Daniel" <danielsanberger@googlemail.com> wrote in message
news:1135100921.943599.303970@g44g2000cwa.googlegroups.com...
> Hi Bill,
>
> thanks for your help. Ok, more precise, I did setup a DbDataReader on
> SQLite. My first question is, what is the advantage of a DataSet
> compared to a DataReader. My second is, if there is a tutorial
> available using a DataSet (at best with SQLite Wrapper!).
>
> Daniel
>



Re: Dis-/Advantages with Datasets on SQLite by Ilya

Ilya
Tue Dec 20 14:43:01 CST 2005

DataSet's do use noticeable amount of memory to store user's data.

As to "much slower than handmade code that iterates and updates from a
DataReader", it's not actually that much.

Our performance tests for SQL Mobile indicate what looping through records
in DataReader, accessing all fields and discarding of data takes about
75-80% of DataAdaper.Fill() time.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Robert Simpson" <rmsimpson@noemail.noemail> wrote in message
news:ujQu2YZBGHA.4076@TK2MSFTNGP14.phx.gbl...
> SQLite, being an ADO.NET wrapper, behaves pretty much exactly the way
> every other ADO.NET provider behaves. Therefore it would be more precise
> and beneficial to explain ADO.NET behavior rather than SQLite behavior.
>
> A DataReader is what ADO.NET uses to populate a DataSet/DataTable. When
> you use a DataAdapter and call the Fill() method, the DataAdapter is
> actually opening up a DataReader and loading all of the columns and data
> into the destination DataSet/DataTable.
>
> The major differences between a DataReader and a DataSet are:
>
> The DataReader is a stream, whereby you read one row from the stream and
> then move to the next row. There is no concept of moving backwards or
> randomly from one row to another. As someone else stated in the forums, a
> DataReader is a firehose.
>
> A DataSet is an in-memory grid-like structure that holds all the rows and
> all the columns from a DataReader. Once the DataSet is filled up you can
> dispose of the DataReader entirely and work with the contents of the
> DataSet in an offline fashion.
>
> Think of a DataSet as a bucket. You aim the firehose at the bucket and
> the bucket collects all the water. You can then stick your cup in the
> bucket and grab whatever amounts of water you want from anywhere in the
> bucket -- but the firehose has been turned off and put away and all
> you're left with is the isolated bucket.
>
> Any changes made to data in a DataSet are tracked. It becomes possible
> then to use a DataAdapter to actually trigger UPDATE/INSERT/DELETE
> statements that can synchronize the changes you've made back to the
> underlying database.
>
> The DataReader has no such capacity. It is read-only. If you want to
> change data you have to generate your own UPDATE/INSERT/DELETE commands
> and execute them.
>
> As for performance ... all the convenient DataSet features that track
> changes, raise events and store all the data come at a cost. DataSets are
> memory hogs and are much slower than handmade code that iterates and
> updates from a DataReader.
>
> Robert
>
>
>
>
> "Daniel" <danielsanberger@googlemail.com> wrote in message
> news:1135100921.943599.303970@g44g2000cwa.googlegroups.com...
>> Hi Bill,
>>
>> thanks for your help. Ok, more precise, I did setup a DbDataReader on
>> SQLite. My first question is, what is the advantage of a DataSet
>> compared to a DataReader. My second is, if there is a tutorial
>> available using a DataSet (at best with SQLite Wrapper!).
>>
>> Daniel
>>
>
>



Re: Dis-/Advantages with Datasets on SQLite by Robert

Robert
Tue Dec 20 15:34:17 CST 2005

"Ilya Tumanov [MS]" <ilyatum@online.microsoft.com> wrote in message
news:43a86cd5$1@news.microsoft.com...
> DataSet's do use noticeable amount of memory to store user's data.
>
> As to "much slower than handmade code that iterates and updates from a
> DataReader", it's not actually that much.
>
> Our performance tests for SQL Mobile indicate what looping through records
> in DataReader, accessing all fields and discarding of data takes about
> 75-80% of DataAdaper.Fill() time.

For reading, it's not that bad. It's when you start doing
updates/inserts/deletes in bulk using a Dataset that things start to go
downhill -- usually due to all the events being raised.

Robert





Re: Dis-/Advantages with Datasets on SQLite by Ilya

Ilya
Tue Dec 20 16:23:26 CST 2005

I don't have performance data for DataAdapter.Update() vs. executing update
commands in a loop. However, I would have to disagree with you.

DataSet's overhead for reading data from it is lower than for inserting - no
constraint checks and no storage allocation.

At the same time inserts are usually slower that selects for the same amount
of data in DB server. That would lead to lower DataSet overhead, not higher.

As to events, it's the factor in loading data as well.


Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Robert Simpson" <rmsimpson@noemail.noemail> wrote in message
news:eL8fi0aBGHA.984@tk2msftngp13.phx.gbl...
> "Ilya Tumanov [MS]" <ilyatum@online.microsoft.com> wrote in message
> news:43a86cd5$1@news.microsoft.com...
>> DataSet's do use noticeable amount of memory to store user's data.
>>
>> As to "much slower than handmade code that iterates and updates from a
>> DataReader", it's not actually that much.
>>
>> Our performance tests for SQL Mobile indicate what looping through
>> records in DataReader, accessing all fields and discarding of data takes
>> about 75-80% of DataAdaper.Fill() time.
>
> For reading, it's not that bad. It's when you start doing
> updates/inserts/deletes in bulk using a Dataset that things start to go
> downhill -- usually due to all the events being raised.
>
> Robert
>
>
>
>



Re: Dis-/Advantages with Datasets on SQLite by Daniel

Daniel
Wed Dec 21 04:28:17 CST 2005

thanks for this very pictured explanation of datasets and datareaders,
it helps me understand much more! I will try it out!

Daniel