Solved

Storing Data locally for Windows App C#

Posted on 2010-08-31
5
547 Views
Last Modified: 2013-11-07
My boss has asked me to make some of the DataTables local to our application.  We currently use both Oracle and Sql,.  It can be static at runtime (ie, we don't need to "Create" it on opening the application).  I am wondering the best way to do this, so far I have thought of three methods

Store as a binary Resource
cons - Do not know how to do this, cannot read

Store as XML

Store as a serializable class (But I am not sure how to populate a class like so)

We do have a strongly typed dataset we use after populating, I am just having a tough time figuring on how it should all tie in - any suggestions ?
0
Comment
Question by:gsdevEE
5 Comments
 
LVL 22

Assisted Solution

by:plusone3055
plusone3055 earned 100 total points
ID: 33569044
Use Microsoft  Access
0
 
LVL 8

Assisted Solution

by:Gururaj Badam
Gururaj Badam earned 100 total points
ID: 33569061
Since you're saying you already have Strongly Typed DS go for Access.
0
 
LVL 1

Accepted Solution

by:
Toby Riley earned 300 total points
ID: 33569278
Hi,

Don't do this. Use SQL CE via entity framework or Db40 (quite excellent) http://www.db4o.com/s/linqdb.aspx  object database. Also if you want some abstraction put around it with a Repository Pattern check out the great NCommon project on github http://github.com/riteshrao/ncommon  and his blog @ http://www.codeinsanity.com

Download the code and look at the unit tests as this is where most of the samples are. There is also a sample app. It's a bit heavy going for the uninitiated but you’ll learn a lot about data access TDD and DDD. Also NCommon can be used against other data ORM’s i.e. NHibernate, PLINQO (My favourite), Entity Framework.

Good luck.
0
 

Author Comment

by:gsdevEE
ID: 33612992
I probable did not word the question right, so I will spit the point among the answers, but I was going more for something like this :

Mark local XML document as embedded content.
Build the project.  
Read the XML :
 public static StronglyTypesDataSet InstanceofDataSet()
        {
            StronglyTypesDataSet data= new StronglyTypesDataSet ();
            Assembly datasetassembly= Assembly.GetAssembly(typeof(StronglyTypesDataSet ));
            Stream byteStream = reflectivePortal.GetManifestResourceStream(EmbeddedXML);
            XmlReaderSettings settings = new XmlReaderSettings();
            settings.ConformanceLevel = ConformanceLevel.Auto;
            settings.IgnoreWhitespace = true;
            settings.IgnoreComments = true;
            XmlReader xmlReader = XmlReader.Create(byteStream);
            data.ReadXml(xmlReader);
            return data;
        }
0
 

Author Closing Comment

by:gsdevEE
ID: 33612999
I was looking for a different better suited solution
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now