Hi,

in a nutshell, is there a quick and efficient way of storing data from
a database on each user's machine so that a WinForm application can
query/analyze/do whatever it wishes to this local data?

the winform app will never need to interact with the original database
except the first time it is run - to create the local data files on
each user's computer. From then on, each time a user runs the
application, the app would be using the local data.

I thought of saving the data as XML files... but I am concerned about
efficiency. As well, I do not need the files to be viewed through
other mediums (web, excel, etc.).

Actually, I would prefer it if the local files are NOT viewable in
other mediums... only the WinForm application would use the files.

If I am able to query data in these local files using SQL (like
"select myCol From file1.dat") that would be also be a huge plus....


I also thought of loading a DataSet object then serializing it to a
file... any links/advice/help on this? I couldnt really find any
specific examples/white papers on serializing data, but I am still
looking.


Any other suggestions? Thank you.

Re: storing data locally? by Marc

Marc
Thu Mar 04 01:03:36 CST 2004

>in a nutshell, is there a quick and efficient way of storing data from
>a database on each user's machine so that a WinForm application can
>query/analyze/do whatever it wishes to this local data?

Yes, sure, serialize your DataSet onto a local file, either by means
of the BinaryFormatter or the SOAPFormatter (XML).

Check out the MSDN Docs on ISerializable interface or the two
formatters.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch

Re: storing data locally? by Miha

Miha
Thu Mar 04 02:52:09 CST 2004

Hi Cip,

Beside the ways Marc suggested there are also DataSet.WriteXml and ReadXml
methods you might find useful.
BTW there is no significant difference between binary and xml serialization
in terms of space.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Cip" <dafunk2001@yahoo.com> wrote in message
news:9f0f419b.0403032044.4c94ef55@posting.google.com...
> Hi,
>
> in a nutshell, is there a quick and efficient way of storing data from
> a database on each user's machine so that a WinForm application can
> query/analyze/do whatever it wishes to this local data?
>
> the winform app will never need to interact with the original database
> except the first time it is run - to create the local data files on
> each user's computer. From then on, each time a user runs the
> application, the app would be using the local data.
>
> I thought of saving the data as XML files... but I am concerned about
> efficiency. As well, I do not need the files to be viewed through
> other mediums (web, excel, etc.).
>
> Actually, I would prefer it if the local files are NOT viewable in
> other mediums... only the WinForm application would use the files.
>
> If I am able to query data in these local files using SQL (like
> "select myCol From file1.dat") that would be also be a huge plus....
>
>
> I also thought of loading a DataSet object then serializing it to a
> file... any links/advice/help on this? I couldnt really find any
> specific examples/white papers on serializing data, but I am still
> looking.
>
>
> Any other suggestions? Thank you.



Re: storing data locally? by dafunk2001

dafunk2001
Thu Mar 04 18:25:55 CST 2004

what about performance of binary vs xml serialization vs
dataset.write/readXML ?

I am not concerned in terms of space or performance in serializing...
my only concern is performance in deserializing (ie loading) the
DataSet.

I have read the article "Serializing Objects" in the .NET Guide, my
initial suspicion is that Binary serialization may be a bit faster
since I do not require any portability associated with XML... i dunno
it just seems that XML serializing or dataset.write/read XML *should*
carry some overhead vs binary serialization.

am i right/wrong? any other last comments would be appreciated.

I guess the only way to be sure is run tests myself, but from both of
your replies it seems that performance differences will be
nonexistant. If that is the case I will still use the binary
formatter since my winForm app will be completely isolated on each
user's machine - data portability across mediums is not an issue here.

thanks again for your time.

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message news:<#2ma0XcAEHA.2800@tk2msftngp13.phx.gbl>...
> Hi Cip,
>
> Beside the ways Marc suggested there are also DataSet.WriteXml and ReadXml
> methods you might find useful.
> BTW there is no significant difference between binary and xml serialization
> in terms of space.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & software development
> miha at rthand com
> www.rthand.com
>
> "Cip" <dafunk2001@yahoo.com> wrote in message
> news:9f0f419b.0403032044.4c94ef55@posting.google.com...
> > Hi,
> >
> > in a nutshell, is there a quick and efficient way of storing data from
> > a database on each user's machine so that a WinForm application can
> > query/analyze/do whatever it wishes to this local data?
> >
> > the winform app will never need to interact with the original database
> > except the first time it is run - to create the local data files on
> > each user's computer. From then on, each time a user runs the
> > application, the app would be using the local data.
> >
> > I thought of saving the data as XML files... but I am concerned about
> > efficiency. As well, I do not need the files to be viewed through
> > other mediums (web, excel, etc.).
> >
> > Actually, I would prefer it if the local files are NOT viewable in
> > other mediums... only the WinForm application would use the files.
> >
> > If I am able to query data in these local files using SQL (like
> > "select myCol From file1.dat") that would be also be a huge plus....
> >
> >
> > I also thought of loading a DataSet object then serializing it to a
> > file... any links/advice/help on this? I couldnt really find any
> > specific examples/white papers on serializing data, but I am still
> > looking.
> >
> >
> > Any other suggestions? Thank you.

Re: storing data locally? by dafunk2001

dafunk2001
Thu Mar 04 18:46:25 CST 2004

actually i just found an amazing article at

http://msdn.microsoft.com/msdnmag/issues/02/12/cuttingedge/default.aspx?

it pretty much explains the architectural differences between all the
options we have brought up in the thread.

The binary formatter when used with DataSet and DataTable objects
actually does output XML so any significant reduction in space
normally attributed to binary formatting is wasted... this might be a
'feature' of .NET maybe? :P

my solution - since portability is not an issue - i will just
implement my own Serializable Class which serializes dataTable
objects. The article discusses this option as well.

That way I will achieve TRUE binary serialization, and hopefully have
faster deserialization times. (my only concern is performance
deserializing... as i mentioned before serializing performance and
space used is no concern)

any other thoughts?

"Miha Markic [MVP C#]" <miha at rthand com> wrote in message news:<#2ma0XcAEHA.2800@tk2msftngp13.phx.gbl>...
> Hi Cip,
>
> Beside the ways Marc suggested there are also DataSet.WriteXml and ReadXml
> methods you might find useful.
> BTW there is no significant difference between binary and xml serialization
> in terms of space.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & software development
> miha at rthand com
> www.rthand.com
>
> "Cip" <dafunk2001@yahoo.com> wrote in message
> news:9f0f419b.0403032044.4c94ef55@posting.google.com...
> > Hi,
> >
> > in a nutshell, is there a quick and efficient way of storing data from
> > a database on each user's machine so that a WinForm application can
> > query/analyze/do whatever it wishes to this local data?
> >
> > the winform app will never need to interact with the original database
> > except the first time it is run - to create the local data files on
> > each user's computer. From then on, each time a user runs the
> > application, the app would be using the local data.
> >
> > I thought of saving the data as XML files... but I am concerned about
> > efficiency. As well, I do not need the files to be viewed through
> > other mediums (web, excel, etc.).
> >
> > Actually, I would prefer it if the local files are NOT viewable in
> > other mediums... only the WinForm application would use the files.
> >
> > If I am able to query data in these local files using SQL (like
> > "select myCol From file1.dat") that would be also be a huge plus....
> >
> >
> > I also thought of loading a DataSet object then serializing it to a
> > file... any links/advice/help on this? I couldnt really find any
> > specific examples/white papers on serializing data, but I am still
> > looking.
> >
> >
> > Any other suggestions? Thank you.

Re: storing data locally? by Miha

Miha
Fri Mar 05 02:47:57 CST 2004

Hi Cip,

"Cip" <dafunk2001@yahoo.com> wrote in message
news:9f0f419b.0403041646.492e29cd@posting.google.com...
> actually i just found an amazing article at
>
> http://msdn.microsoft.com/msdnmag/issues/02/12/cuttingedge/default.aspx?
>
> it pretty much explains the architectural differences between all the
> options we have brought up in the thread.
>
> The binary formatter when used with DataSet and DataTable objects
> actually does output XML so any significant reduction in space
> normally attributed to binary formatting is wasted... this might be a
> 'feature' of .NET maybe? :P
>
> my solution - since portability is not an issue - i will just
> implement my own Serializable Class which serializes dataTable
> objects. The article discusses this option as well.
>
> That way I will achieve TRUE binary serialization, and hopefully have
> faster deserialization times. (my only concern is performance
> deserializing... as i mentioned before serializing performance and
> space used is no concern)
>
> any other thoughts?

You've got it.
A while ago I saw a greate binary serialization for datasets, however I
don't have a link at this time.
If I find it, I'll post it.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com



Re: storing data locally? by anonymous

anonymous
Fri Mar 05 09:41:10 CST 2004

Hi Miha

I hope you'll find it, we've been looking for something like this for a few days. I guess the main problem with Deserialization of datasets is the TIME it takes! We're trying to pass datasets with the .NET remoting architecture and the Deserialization kills the performance


----- Miha Markic [MVP C#] wrote: ----

<message cut
You've got it
A while ago I saw a greate binary serialization for datasets, however
don't have a link at this time
If I find it, I'll post it

--
Miha Markic [MVP C#] - RightHand .NET consulting & software developmen
miha at rthand co
www.rthand.co




Re: storing data locally? by Ravi[MSFT]

Ravi[MSFT]
Fri Mar 05 12:38:00 CST 2004

We are aware of the performance issue of remoting dataset in V1.x. We will
be fixing it for the next version. In the mean time, to alleviate the
performance issue associated with dataset remoting in V1.x, we've created an
interim surrogate class [sort of a wrapper around DataSet]. You basically
remote this surrogate object over the wire and convert it back into DataSet
after the surrogate object gets deserialized. You can see the MSDN KB
article on the DataSetSurrogate article at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;829740

Thanks,
Ravi

"Aljovin" <anonymous@discussions.microsoft.com> wrote in message
news:63B5FBC0-FB80-415C-B208-F737FEE8EBE9@microsoft.com...
> Hi Miha,
>
> I hope you'll find it, we've been looking for something like this for a
few days. I guess the main problem with Deserialization of datasets is the
TIME it takes! We're trying to pass datasets with the .NET remoting
architecture and the Deserialization kills the performance.
>
>
> ----- Miha Markic [MVP C#] wrote: -----
>
> <message cut>
> You've got it.
> A while ago I saw a greate binary serialization for datasets, however
I
> don't have a link at this time.
> If I find it, I'll post it.
>
> --
> Miha Markic [MVP C#] - RightHand .NET consulting & software
development
> miha at rthand com
> www.rthand.com
>
>
>