in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

How to prevent automatic creating of DB file?

Last post 09-25-2007 8:45 AM by Robert Simpson. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-29-2007 4:50 AM

    How to prevent automatic creating of DB file?

        Hi all,

       The db file, used in my application is located in bin/debug directory. If I remove it manually and start my application, it creates it automatically, which actually in my case is wrong. Has something to be changed in my app.config file? Here is my code:

     
      <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <appSettings>
        <add key ="Test" value="Data Source={0};Version=3;"/>
        <add key ="DBFileName" value="Test.sqlite" />
        <add key ="ErrorLogFile" value="Logs\Error.log" />
      </appSettings>       
    </configuration>
     

    10x!

    my6u4ka 

      
     

  • 09-25-2007 8:45 AM In reply to

    Re: How to prevent automatic creating of DB file?

    If you're using the latest version, check the Help File for connectionstring settings.  You can add "FailIfMissing=True" to the connection string and the code will throw an error if the database is not there.

    Robert

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems