Integrated Database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrih

    #1

    Integrated Database

    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é
  • William Ryan  eMVP

    #2
    Re: Integrated Database


    "Andrih" <andrih@gmx.d e> wrote in message
    news:9319bac3.0 405080659.57927 df4@posting.goo gle.com...[color=blue]
    > 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[/color]
    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).[color=blue]
    > Is it possible to have a integrated small MSSQL-Database and use SQL?[/color]
    Yes, just submit your changes frequently.[color=blue]
    > Or do i have to use a hashtable or a array and load it from a file at[/color]
    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)[color=blue]
    > startup, and save it to a file when the program shuts down? If yes, in
    > what kind of file should i save it?[/color]
    XML is a great choice, text delimmited is also another one without the
    overhaed of the xml tags[color=blue]
    > I am happy about every response!
    > Thanks in advance,
    > André[/color]


    Comment

    • Andrih

      #3
      Re: Integrated Database

      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é

      "William Ryan eMVP" <dotnetguru@com cast.nospam.net > wrote in message news:<ea8ePBRNE HA.3096@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
      > "Andrih" <andrih@gmx.d e> wrote in message
      > news:9319bac3.0 405080659.57927 df4@posting.goo gle.com...[color=green]
      > > 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[/color]
      > 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).[color=green]
      > > Is it possible to have a integrated small MSSQL-Database and use SQL?[/color]
      > Yes, just submit your changes frequently.[color=green]
      > > Or do i have to use a hashtable or a array and load it from a file at[/color]
      > 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)[color=green]
      > > startup, and save it to a file when the program shuts down? If yes, in
      > > what kind of file should i save it?[/color]
      > XML is a great choice, text delimmited is also another one without the
      > overhaed of the xml tags[color=green]
      > > I am happy about every response!
      > > Thanks in advance,
      > > André[/color][/color]

      Comment

      Working...