Solved

Storing Data locally for Windows App C#

Posted on 2010-08-31
5
552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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