Integrated Database

  • Thread starter Thread starter Andrih
  • Start date Start date
A

Andrih

Our .net Application requires a table with two columns.
Both columns are text of 40 chars.
The table has to be static, after reseting the application, all
records must still be available. The table could in some cases have
10.000 records, and hase to be as fast as possible (Index).
Is it possible to have a integrated small MSSQL-Database and use SQL?
Or do i have to use a hashtable or a array and load it from a file at
startup, and save it to a file when the program shuts down? If yes, in
what kind of file should i save it?
I am happy about every response!
Thanks in advance,
André
 
Andrih said:
Our .net Application requires a table with two columns.
Both columns are text of 40 chars.
The table has to be static, after reseting the application, all
records must still be available. The table could in some cases have
10.000 records, and hase to be as fast as possible
One choice is to create a dataset and a datatable in it. Store everything
in there. At the beginning to the session, load it from dataSet.ReadXML and
write it out at the end with WriteXML. You'll need to do these frequenty
though to ensure against damage from poweroutages and unintended stuff like
that.
(Index).
Is it possible to have a integrated small MSSQL-Database and use SQL?
Yes, just submit your changes frequently.
Or do i have to use a hashtable or a array and load it from a file at
You could do this too, but using a datatable/dataset would be a little more
straightforward code wise in many cases. (I live in ADO.NET though, so I may
be slightly biased)
startup, and save it to a file when the program shuts down? If yes, in
what kind of file should i save it?
XML is a great choice, text delimmited is also another one without the
overhaed of the xml tags
 
Thank you a lot for your response, William!
I understand your suggestion, but there is one thing, that i missed to
say.
There are 2 application running on the same machine at the same time,
that need to read and change the table, wich is a typical task for a
normal database like MS SQL-Server or other.
But the solution must be distributable and so i cannot use MSSQL. My
question is, whether there exists any small integrated database driver
in .net or wether there is any way to integrate a small database in my
app.
Right now my work-around is, that i use your solution with the
difference that i open (ReadXML) the Dataset before any change or read
and save it after any change. But this is very bad for performance and
therfore only works with small datatables.
I am happy every response, even if you tell me, you don´t know any
solution.
André
 
Back
Top