DataBase

  • Thread starter Thread starter John Arthur
  • Start date Start date
J

John Arthur

Hi,

I need to create a small application that uses a file to write and
store some data and then uses this data. What I actually need to know
is it posible to create this as a database and create tables in it,
and then read info from this tables with "select" - some kind of a
database, but I need it not to use any SQl server. Just a file to
write in. May be some kind of a .dat file. I heard the Windows has
samething like that build in. So if I uses C# may be I will be able to
use it?
Can someone help me with that.

Thankes.
 
John,

You should be able to make it an MDB file (an access database file). As
long as you have MDAC installed on the machine (which most machines do), you
should be able to access the file through the OleDb data provider in the
System.Data.OleDb namespace.

You should also be able to rename your file to whatever extension you
want, and use that.

Hope this helps.
 
You can use XML to store the data pretty easily. If you build the tables
with ADO.net you can import or export the data to XML. For a small
application without a real db I think it is better than a flat file.
 
I am preaty new to ADO.NET, so let me see if I get it right.
So if I have some kind of a DataSet I will be able to save it in a
XML.Next time I start the aplication I will be able to load it in the
DataSet, so whe whole data will be in the memory.
But how I will run a select query against this data set?

And do you know something a databse that comes directly with windows. I
heard something that dbase in the newest version of windows is fully
suported.

Thankes.
 
It's been a while since I did that but I don't believe you even need a
dataset. I think you can just create a datatable with the columns the way
you want. Then if you populate it with some rows you can save the data as
an XML document (I will look up the method when I get back) on your hard
drive. And later on you can import it back into the datatable. Once it is
in the datatable you can do anything you normally can against it such as
selects, filters etc. It does not matter where the data came from, the
databale behaves pretty much the same. Sorry I don't know anything about
dbase being supported with windows other than there are odbc and possibly
oledb drivers for it now,
 
Actualy I just took a look at one of the projects I played around with in VB
a while back and I did in fact use a DataSet. Take a look at the DataSet
methods for:

ds.ReadXmlSchema("c:\attendees_Schema.xml")

ds.ReadXml("c:\Attendees_Data.xml")

There are also equivelent Write methods as well.
 
Back
Top