1

I create an application using C# and SQL Server database, when I try to create the setup I realized that I need to install SQL Server and create the database in every computer that I install my app on.

Is there any way or software can create the setup with the database without install the SQL server in other computers?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Camper
  • 15
  • 4
  • You can copy `mdf` and `ldf` DB files from Setup. If the application with use SQL, there is no way to avoid installation of SQL Server. – i486 Mar 13 '16 at 10:41
  • http://stackoverflow.com/questions/9655362/localdb-deployment-on-client-pc but read about the limitations on LocalDB in particular regarding data sharing – Steve Mar 13 '16 at 10:46
  • `SQL Server` was not the best choice here, if you just need to store data locally. I use `SQLite`. It is small, fast (as long as you do not need many concurrent write processes) and needs no installation – Flat Eric Mar 13 '16 at 10:49
  • 1
    @FlatEric this is a decision to make at the start of the planning process, not at setup time unless you are suggesting to rewrite everything. Good for the next time.. – Steve Mar 13 '16 at 10:52

1 Answers1

0

If your storing data locally you are better off to use SQLite (as Flat Eric mentioned, it needs no installation and it efficient on small DB's) then you can just copy the .mdf files instead of having to install the entire SQL server on every machine. Visual Studio provides great functionality to help you set up a LocalDB.

Here are two useful links, They really helped me in these situations:

Upgrade to LocalDB

Creating a Local Database File in Visual Studio

Connecting to Data in a Local Database File (Windows Forms)

AnonDCX
  • 2,501
  • 2
  • 17
  • 25