Groups | Blog | Home
all groups > dotnet ado.net > january 2005 >

dotnet ado.net : Dataset as a database - is it possible?


Mike Peretz
1/31/2005 11:53:48 PM
I would like to use a dataset as a data file (like a database). However, I
didn't find a way to use SQL on the Dataset (except on a DataView, but then
Dataset is all loaded.). I also noted that I must flush the whole dataset to
disk and load it all to read it. I wonder, if there is a better way to use a
dataset as a persistent storage.

Scott M.
2/1/2005 12:55:49 AM
You can think of a DataSet as a RDBMS held in memory.

Why do you need to use SQL on a DataSet (there are other ways to CRUD with a
DataSet)?

DataSets are XML Serializable, so taking its contents and storing it to disk
as XML and then reading from that XML is a relatively easy thing to do.

[quoted text, click to view]

Sahil Malik
2/1/2005 2:31:47 AM
It is a really underpowered database - so don't go putting millions of rows
in it.

Other ways to browse data in a dataset are DataTable.Select, Find, Relations
(GetChildRows, GetParentRow). etc.

And instead of complete flush and reload, you could instead do a
dataset.merge.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/


[quoted text, click to view]

Cor Ligthert
2/1/2005 11:58:48 AM
Mike,

The answer is simple, No.

The XML file is a file. Not a database.

By instance is it complete single user.

Cor

Miha Markic [MVP C#]
2/1/2005 1:08:27 PM
Hi Mike,

What are you trying to achieve?
If you want a "no-installation" database you might take a look at Firebird.
Here is an article on this topic:
http://www.codeproject.com/useritems/EmbeddedFirebird.asp

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com

[quoted text, click to view]

Extreme Datasets
2/1/2005 7:19:02 PM
Hello Mike,

As long as you are just storing items and don't need a full fledged RDBMS,
ie a small application or a configuration file, i would go with Scott and
persist as an xml file. Also, you don't need to flush you can update, delete,
insert on your dataset.

In addition to Miha, it really depends on what you are trying to accomplish

[quoted text, click to view]
Mike Peretz
2/3/2005 6:28:24 PM
This is for a very simple layout that will hold no more then 50 records.
Thank you for all your feedback, I think my approch is fine, as long as I
don't go nuts with volunme.


"Extreme Datasets" <ExtremeDatasets@discussions.microsoft.com> wrote in
message news:9E90BC18-B295-4A99-AEEE-E5BAF0CD0D7D@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button