Click here to Skip to main content
15,886,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have create a windows form application on c# using SQL database, and create a setup also with the prerequisites ".net framework and SQL EXPRESS " and it run on my computer with no problem .. but when i take this copy of installation to another computer the application doesn't run and when i open the task manager i find it on the background process and after few seconds gone .. (windows 10, sqlserver 2012, visual studio 2017)

adding : when i setup the application on my computer it work correctly using his including database

What I have tried:

i tried to setup sql express on the other computer and the net framework that i use on my computer .
Posted
Updated 8-Sep-18 23:25pm

1 solution

You should not include SQL Server in your installation. There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.

If you want a single user DB system, then use Access, SqlLite, or Sql Compact - don;t proliferate SQL Server instances to production!
If you want a multi user DB System, then you need to find the appropriate existing SQL Server instance at the client site and load your DB onto that.
 
Share this answer
 
Comments
3akram 9-Sep-18 3:37am    
thank you for your advice .. sorry because English is not my first language .. now i should change the data base that i used in this application and create a new one using access, SqlLite or Sql Compact but i shouldn't use sql server in my application .. right ? ..
second .. i don't understand why my app didn't work .. on another computer .. that have sql express ? is that because i used in my app sql server and on the other computer sql express ?

thanks again :)
OriginalGriff 9-Sep-18 5:36am    
SQL Server is designed as a multiuser DB - and it's a big, complicated piece of software as a result. If you don't need multiuser, then don't use a server based DB at all - use a single user DB, which are smaller, simpler, take up less resources on the client computer, and don't require complex installation. All they need is a couple of DLL assemblies shipped with your app.

Generally speaking production SQL Server is configured differently from the Express edition - the latter is meant for development, not production and so you generally access it via Windows Authorisation. Production ones need better protection, so you need a user account to connect to, which must have the relevant permissions for the specific DB you are accessing, and you probably need admin access to create or modify a DB.
3akram 9-Sep-18 19:09pm    
thank you, now i use SQLite , i will drop all data base and create it again using SQLite
OriginalGriff 10-Sep-18 1:25am    
You're welcome!
3akram 10-Sep-18 1:36am    
I have created my database using sqlite .. and still the same issue but now i know why 😂 .. in sqliteconnection simply send a string of that carry the path of the database in my local .. when i copy the program it doesn't run because of the connection isn't open on any local .. because there is no path connection in the application

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900