Solved

Storing Data locally for Windows App C#

Posted on 2010-08-31
5
551 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Upgrading my SSIS package in VS 2012 6 84
VS 2017 18 101
Starting to use Git with Visual  Studio Online 1 16
Web page design problem 3 11
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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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