Search code examples
c#visual-studio-2017setup-projectsql-server-2017

Create Setup Project in Visual Studio 2017 (with MSSQL Server Database)


I did a project using C# (Windows Form Application), and I used MSSQL Server 2017 for database operations. My project is as follows; the user selects a value from the listbox and presses the button for analysis. After this process, I perform a mathematical operation on the values ​​from the table and list the results on the DataGridView. So, the user will not do any action on the database, you can think of it as read only.

  • What kind of problems can I experience when installing this project to the user?
  • Do I need to install MSSQL Server to the user? I set it up on my own computer and I installed it on my computer and there was no problem, I have added a backup of my database in the MSSQL Server into my setup file. Is it enough to be this way?
  • Will I have problems with database operations when I install it on another computer?
  • Will I need to change the SQL connection clause?

Solution

  • Well, using SQL Server for this is extreme, to say the least. SQL Server is better for database-intensive applications, it requires setting up a lot of stuff on the computer and it's generally not used for client-side applications, although big desktop applications might use SQL Server Express (a downsized, free version) if they require so much performance.

    I would suggest you to leave that aside and use SQL Server Express LocalDb (a .mdb file), which can be installed pretty easily; or you could even use SQLite which requires no installation.

    Regarding your questions:

    What kind of problems can I experience when installing this project to the user?

    You will probably run many issues, the SQL Server setup can fail due to thousands of different problems and uninstallation can very easily leave the system in a corrupt state.

    Do I need to install MSSQL Server to the user? I set it up on my own computer and I installed it on my computer and there was no problem, I have added a backup of my database in the MSSQL Server into my setup file. Is it enough to be this way?

    If you wanted to use SQL Server, then yes, installation would be required.

    Will I have problems with database operations when I install it on another computer?

    Assuming the installation went OK, not probably.

    Will I need to change the SQL connection clause?

    Not really, using Server= .\KnownServerInstanceName would be enough to make it work always.