-3

I need to develop a standalone windows application that will work offline. I have decided to implement it using C# and WPF. However because the application database should be able to run without having to install Sql Server on the client's desktop, am not sure what's the best approach.

The concept is that i will develop the application give the executable to the client, install and run the application without any complexity of connecting database.

So far i am considering to use SQLite.

My question is what's the best solution to connect a database within the application.

Cipher
  • 37
  • 5
  • Not sure this is the place for a question like this. Really you should be researching the different options available to you and then selecting one based on the constraints. But you really should do your research so that you can understand why you have chosen what you have. – Stephen Wilson Jul 26 '16 at 11:20

2 Answers2

2
  • SqlLite is the best option to go so as to have both the sql features and also a offline db.
  • If the data is very, very simple, and you need it to be readable by other applications or users (with appropriate permissions), I would probably choose to store it in an XML file or even a plain-text file inside the user's Application Data folder, which would be obtained via Environment.GetFolderPath.

  • If you want to store files such as images,etc then you should go for IsolatedStorage.

Tarun Pothulapati
  • 572
  • 1
  • 5
  • 13
0

Use EntityFramework to connect to SQLite, my preference is always to use the code-first database so everythings managed from your C# code, I believe EF can be modified to implement INotifyPropertyChanged on your behalf which will help setting up your bindings in WPF.

XML shouldn't be used for anything except for configuration IMHO, it will soon be deprecated in favour of JSON, I'm sure of it, not that that really affects you.

Community
  • 1
  • 1
Dead.Rabit
  • 1,965
  • 1
  • 28
  • 46