Mark Moeykens
3/25/2008 9:48:00 PM
Oh wow! I didn't know that! That sounds really exciting. It seems I need to
study up on this and figure it out more.
So basically it sounds like when the user opens a .sdf file through an open
dialog box I just set that path as the .sdf's connection string. And when
they want to create a new .sdf...well, I imagine you just instantiate this
object and then write code to create all the tables necessary in memory until
the user wants to save it and then I just create/persist the object as a .sdf
file. I'll have to research that part to see how to dynamically create and
persist these files.
Thanks for the heads up though, that definitely sounds like a better deal
than the xml files.
"William Vaughn [MVP]" wrote:
> Then I'm confused.
> You can easily persist to the .SDF SQLCe database file and encrypt it. It
> can then be copied and passed to any number of users with the added benefit
> of it being smaller and more secure. While an XML file is easily read by
> anyone with Notepad, the .SDF file cannot--it can only be read by your code
> or someone who knows how to open a SQLCe database and has the password. The
> SQLCe files are meant to be mailed, passed around and shared without risk of
> compromising the data or corrupting it. You can't promise that with XML.
>
> --
> __________________________________________________________________________
> William R. Vaughn
> President and Founder Beta V Corporation
> Author, Mentor, Dad, Grandpa
> Microsoft MVP
> (425) 556-9205 (Pacific time)
> Hitchhiker???s Guide to Visual Studio and SQL Server (7th Edition)
> ____________________________________________________________________________________________
> "Mark Moeykens" <MarkMoeykens@discussions.microsoft.com> wrote in message
> news:D39580B9-8A75-47A5-B5B5-EC23E6857A89@microsoft.com...
> > Thanks guys. I have already incorporated SQL CE into my app and it works
> > great with the DataSet and TableAdapters.
> >
> > I'll still be sticking with the XML DataSet output so they can save their
> > information to a file. It's important that they can use the app, enter a
> > lot
> > of information and then save it off and send it to another person.
> >
> > Use the DataSet.WriteXml() is so easy that it's the best method I can
> > think
> > of at this point in development.
> >
> > "William Vaughn [MVP]" wrote:
> >
> >> Yes, SQLCe makes a lot of sense here. It has a host of advantages over
> >> XML
> >> (don't get me started). And yes, ADO.NET 3.5 Sync Services does work with
> >> (is designed to work with) SQLCe. This engine is designed from the ground
> >> up
> >> as a Subscriber in a replication architecture.
> >>
> >> --
> >> __________________________________________________________________________
> >> William R. Vaughn
> >> President and Founder Beta V Corporation
> >> Author, Mentor, Dad, Grandpa
> >> Microsoft MVP
> >> (425) 556-9205 (Pacific time)
> >> Hitchhiker???s Guide to Visual Studio and SQL Server (7th Edition)
> >> ____________________________________________________________________________________________
> >> "RobinS" <robins@imnottelling.com> wrote in message
> >> news:5pmdnbvP28C93nranZ2dnUVZ_tGonZ2d@comcast.com...
> >> > You can deploy SQLCE for free with your application. Bill Vaughn has a
> >> > e-book on it SQL CE if you're looking for information on it. But it's
> >> > only for one user. But I think you can then use Sync Services (new I
> >> > think) to sync with SQLServer on a server if you want to.
> >> >
> >> > It's kind of roundabout to use XML and SQLServer both. Probably just
> >> > figuring out how to do XML is what will help you.
> >> >
> >> > RobinS.
> >> >
> >> >
> >> > "Mark Moeykens" <MarkMoeykens@discussions.microsoft.com> wrote in
> >> > message
> >> > news:EA89989F-DB6D-4DD7-971F-181F03C9EBC4@microsoft.com...
> >> >> Yeah, I've looked into many options and I think it's all going to come
> >> >> down
> >> >> to having to manually writing code and queries and more unit tests.
> >> >> Anyone
> >> >> know of any VS addins that can make querying xml easier like DataSet
> >> >> TableAdapters do for SQL Servers?
> >> >>
> >> >> I've also thought about the possibility of loading the xml into a
> >> >> DataSet
> >> >> that's connected to an .sdf (SQL Compact Edition Database). Then I
> >> >> could
> >> >> create the Tables and TableAdapters and have autogenerated methods to
> >> >> return
> >> >> data from the TableAdapters. The sdf would be nothing more than a
> >> >> temporary
> >> >> holder of the data with the DataSet facilitating with the selects,
> >> >> inserts,
> >> >> updates and deleting of data. Then when the user saves I do a
> >> >> DataSet.WriteXml.
> >> >>
> >> >> I'll have to look into packaging and deployment and the SQL Compact
> >> >> Edition.
> >> >>
> >> >> Mark Moeykens
> >> >>
> >> >> "RobinS" wrote:
> >> >>
> >> >>> Have you checked out Linq-to-XML? That sounds like something you
> >> >>> would
> >> >>> be
> >> >>> interested in. It's a .Net 3.5 feature.
> >> >>>
> >> >>> RobinS.
> >> >>> GoldMail.com
> >> >>>
> >> >>> "Mark Moeykens" <MarkMoeykens@discussions.microsoft.com> wrote in
> >> >>> message
> >> >>> news:EAFAF224-0C0D-4AC8-BC7B-F0B00097BA16@microsoft.com...
> >> >>> > I'm building a WPF app for single users. They enter data, saves to
> >> >>> > xml
> >> >>> > file.
> >> >>> > They can share this xml document with others who have the same app.
> >> >>> >
> >> >>> > I wanted to keep it simple so basically when they open the xml file
> >> >>> > I
> >> >>> > do
> >> >>> > a:
> >> >>> > DataSet.ReadXml("filePathToXml");
> >> >>> > When they save their work I do a:
> >> >>> > DataSet.WriteXml("filePathToSaveLocation");
> >> >>> >
> >> >>> > Now that I'm further into development I'd like an easier way to
> >> >>> > query
> >> >>> > that
> >> >>> > data in the dataset with some kind of complex joins.
> >> >>> >
> >> >>> > I know from my full-time job we use DataSets connected to SQL and
> >> >>> > just
> >> >>> > add
> >> >>> > TableAdapters hooked to stored procedures or sometimes just write
> >> >>> > the
> >> >>> > query
> >> >>> > right in the TableAdapter methods.
> >> >>> >
> >> >>> > This sounds good but I find that 2008 doesn't offer this ability
> >> >>> > for
> >> >>> > Xml
> >> >>> > files as far as I can see. Maybe because I just have the Standard
> >> >>> > version
> >> >>> > of
> >> >>> > Visual Studio.
> >> >>> >
> >> >>> > So does anyone know how I can take advantage of the TableAdapter
> >> >>> > querying
> >> >>> > capabilities with an Xml file as the datasource? Can it be done?
> >> >>> > If
> >> >>> > not,
> >> >>> > should I pursue a different direction?
> >> >>> >
> >> >>> > Thanks!
> >> >>> > Mark Moeykens
> >> >>>
> >> >>>
> >> >
> >>
> >>
>