How to compile the database to install together with a C#application?

Asked

Viewed 3,282 times

10

I’m developing an application in c#, and I need to know if I can compile the database to install together with the application, I’ve seen something here talking about Sqlite, but I don’t know the tool and I don’t know if it stores images, and in my case I will have a stream of an image per register, I thought in Localdb, but it stores only 10GB, which I think will fill soon, well, I thought in Mysql that I have used for web applications and I know the tool, well go the questions.

  1. I can easily integrate Mysql into a project in Visual Studio?

  2. Compensates to use Mysql in a desktop application for registration?

  3. How to install the bank together with the application?

  4. If not, which bank has integration with c#, is large enough for a good flow of registrations and can be easily added to the project?

  • I have seen around using software installers (INNO SETUP and etc) and together, with these installers the databases and etc. Now, relational databases should be taken care of. If on the client’s machine there is no installed one, the installer will install it, but it is necessary that whoever is purchasing your system has an understanding to follow the installation. I don’t know if it would be a good one. As for Sql Lite, I don’t know.

  • 1

    You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? Something needs to be improved?

1 answer

11

Let it be clear that in this answer I am talking about purely desktop applications. I am not talking about client server where the client is an executable to run on the desktop and the database will be on the server for access by multiple clients.

In the client/server scenario the desktop application will be installed separately from the server, so the question would not fit.

The scenario described in the question is for applications standalone, where the database is closely linked to the executable and will only be accessed by it.

Mysql

Without many details it is not easy to give an accurate answer, but in a general way it is not worth using Mysql for a desktop application like this. Then the other questions would not make sense. Of course has to install together, but should not.

  • Mysql needs to be installed, a lot can happen wrong in this process. Not to mention the size that should go along with the application.
  • And you have to keep running. It takes up a lot of memory. And unsuspecting users can easily compromise their operation when they detect weird things on your computer (it can run on demand, but it doesn’t help much and can bring other problems).
  • It’s common to need maintenance, and it’s not that simple.
  • It is a cannon to kill bird. Much of what it offers is not necessary in this scenario.
  • There may be other problems in specific scenarios. For example, there may already be a Mysql on the machine for something else. You would have conflict or you would need to be prepared to deal with it, which is too much for something that should be simple.

Sqlite

  • Sqlite is the standard database for desktop applications (not servers).
  • It can do essentially everything that Mysql can. The difference is that it is not a server (great in this case), and that it cannot do a lot of really simultaneous writing as big as Mysql, but the difference is not brutal and on the desktop this should not occur, on the contrary, it will probably only be necessary to write one at a time.

Information about the additional component you need to attach to the project for your use can be obtained from official page of it. You don’t need to install it, it becomes part of the application.

The Nuget packages found on the download page are easier to handle.

Contrary to what some people think, Sqlite can also be used, and I use successfully, in client/server scenario (has my answer down showing how), but then may not be the most suitable solution. See more about its use.

If you have specific questions, ask them in individual questions.

  • I am making a desktop application with Mysql and based on your answer is it more correct, efficient or effective to use Sqlite than Mysql? What are the advantages and disadvantages of using Sqlite than Mysql?

  • It depends on each case. I think the advantages are there, if to go into more detail it would need to be in new question. I updated to clarify an important point, before there is confusion about the term "desktop application". I do not know what is your case.

  • So let me ask you a question about this detailing my case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.