Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to publish a desktop application in another host computer. I tried publishing with SQL Server Compact but it didn't work. What changes should I make in Visual Studio and SQL Server so I can install my application in any computer?

What I have tried:

What changes should I make to the install my application in any computer?
Posted
Updated 5-Aug-17 5:41am
Comments
F-ES Sitecore 25-Jul-17 7:36am    
If your app relies on SQL Server the target machine needs access to their own SQL Server, SQL is not a distributable project. You'll need to use a DB that you can distribute like SQLite, SQL Compact etc. If you've tried SQL Compact but can't get that working you need to spend time fixing that issue rather than focussing on a solution that you'll get get working.

Just do not do that. Just do not do that. Just do not do that.

Why do you require your clients to install a full SQL Server engine, just to install your application? SQL Server comes with minimal of around 1 GB of installation, with a lot of configurations, setup, account management and all. Why do you want that?

Instead of this, consider SQLite database for the C# applications (or .NET framework itself). SQL Server Compact Edition has been lost in the woods, and even Microsoft has started using SQLite databases, for instance in their UWP platform. It shows a great potential, and for minor requirements of the data source on the local machines you can use this "engine-free" database. It does not require any prior installation. You just ask the engine to connect to a database, or create one for you if it doesn't exist.

It is just a simple db.sqlite database, which contains all of your content and supports typically (but not all!) features of a database engine. Look into it, instead of forcing your clients to install SQL Server.

For a sample, please read this: Getting started with SQLite in C# – Tigran's Blog[^]

System.Data.SQLite FAQs[^]

But if you really want to do that, install a SQL Server instance on a hosted web application, such as a website and allow your clients to connect to that database. It will help you in a lot of cases, you will only have to manage a single database instead of a database engine installed on each client.

Plus, what about those clients who cannot afford this? You will end up losing a lot of clients and potential customers.
 
Share this answer
 
v2
Comments
Deekshaa Singh Chauhan 27-Jul-17 5:18am    
my software work in windows 7 bt it not working on windows xp
Afzaal Ahmad Zeeshan 27-Jul-17 5:25am    
The reason for it not running, please?
Deekshaa Singh Chauhan 16-Aug-17 3:14am    
what?
Quote:
I tried publishing with SQL Server Compact but it didn't work.

So find out why.
SQL Sever Compact (or SQL CE) is trivial to publish with your app - it's a couple of simple DLL assemblies. SQL Server requires "proper" installation, which means planning, topography, user accounts and permissions, an someone who knows what they are doing to administer it on a day-to-day basis, and back it up on a regular schedule.

You shouldn't even think of insisting your users install SQL Server unless your app needs multiuser access to the DB.
 
Share this answer
 
If you need to install SQL Server, .NET framework or Visual C runtimes along with your application, here is an interesting 'InnoSetup Dependency Installer':
GitHub - stfx/innodependencyinstaller: Modular InnoSetup Dependency Installer[^]The nice thing is that everything is done using the web installer versions, so your setup package remains small !
 
Share this answer
 

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