I am developing a .NET (C#) application with a binary file format. The plan is to migrate to binary format to an SQLite database file which is easier to maintain.
I have never used this before so I have a few questions.
-
The SQLite implementation of http://sqlite.phxsoftware.com/ contains a LINQ provider. I have played with it locally, but I somehow have to incorporate this into something a team of developers can use. I can place the database file on my PC in a folder which is included in the source repository, but eventually it should end up in the clients AppData folder. How can I achieve this using a generated database file? When I create the database file manually I can easily tell the application where to store it.
-
I have a fair knowledge of SQL queries, so my initial plan was to create a library which does a port of a DataModel to the database using SQL queries. The downside of this is that when a field changes or is added I have to update a lot of things: The database create query, the database update or alter queries, the DataModel. From what I gather I can create a database using the designer, but when my application is updated to version 2 next month and my database changes I want to migrate the user’s existing database to the new version. Doing this manually I can write update queries and work with some sort of incremental database counter to check this, but how does this work using a generated database?
So is it better, easier and safer to use SQL queries directly, or can someone point me to a decent usable use-case of using a generated database?
Thanks.
For your first question I can suggest you to make your application in ASP.Net or make use of webservice (the second is more suitable for your objectives). For webservices I think you should code a session in the call of a method like this:
For your second question I suggest to use FluentNhibernate. I’ve used FluentNhibernate and is very easy to model your database and even generate it. This is just a glimpse of the code used to configure the SQLite implementation;
You can see the FluentNhibernate wiki page and there’s a introductory implementation of this framework. Finally to admin your SQLite database I suggest you to use SQLite Administrator.