Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Database in project files.

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
TommyTwoPints
Asked:
TommyTwoPints
  • 3
  • 3
1 Solution
 
DhaestCommented:
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
 
TommyTwoPintsAuthor Commented:
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
 
DhaestCommented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TommyTwoPintsAuthor Commented:
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
 
DhaestCommented:
0
 
TommyTwoPintsAuthor Commented:
Thanks alot Dhaest, you've been a great help!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now