Solved

Database in project files.

Posted on 2008-10-09
6
242 Views
Last Modified: 2013-11-07
Hi Experts,

Is there a way of storing data in my application's project file(s) so it can be read with an OLEDB connection?

Cheers

Tom
0
Comment
Question by:TommyTwoPints
[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
  • 3
  • 3
6 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 22684670
What exactly do you want to store in your project-database ?

I'm not sure if this can help you
Database Projects in Visual Studio .NET
http://aspnet.4guysfromrolla.com/articles/071305-1.aspx
0
 
LVL 3

Author Comment

by:TommyTwoPints
ID: 22684705
Hi Dhaest.
My project is a winforms application that creates charts in PowerPoint from database tables. I would just like to know if rather than having the database tables in a seperate file; I could actually store the data in my project file that stores all the project information. At the moment the project file is in XML format but I guess this would have to be changed to accomodate this type of database. Unless I can read from XML using a connection string.
I just want to know if there is a way I can create my project files so they contain database tables that can be accessed by connection strings and commands.
Thanks
Tom
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 22684713
You can read a xml-file into a dataset and use this dataset to perform everything you want.

This is a very easy way to populate a dataset from an xml file. 
 
 
'load xml into a dataset to use here
Dim dSet As New DataSet
Dim fs As FileStream
 
 
'open the xml file so we can use it to fill the dataset
Try
   fs = New FileStream("C:\someXMLfile.xml, FileMode.Open)
Catch e As Exception
   Debug.WriteLine(e)
End Try
 
 
'fill the dataset
Try
   dSet.ReadXml(fs)
Catch ex As Exception
   Debug.WriteLine(ex)
Finally
   fs.Close()
End Try

Open in new window

0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 3

Author Comment

by:TommyTwoPints
ID: 22684748
Could you give me a few examples of working with the data set. Select, Insert & creating a view from the dataset would be nice.
Also; what happens if the XML file contains other settings that isnt related to the data I want to work with? Can I strip the XML containing the data into a memory stream and read the XML from there?
Thanks alot

Tom
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 22684787
0
 
LVL 3

Author Comment

by:TommyTwoPints
ID: 22684797
Thanks alot Dhaest, you've been a great help!
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

734 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