Deploy application using installshield - c#

I have developed an WPF application using .Net 4.0 framework. I have installed SQL 2012 Express edition on my machine .
My application performs basic CRUD operations on this database using appropriate connectionstring. I am very new to deployment. so my question is How can I deploy my mdf files at the client end ? I cannot install ~130MB of software at client end just for my 4MB of mdf files it doesn't make sense. Also while deploying project I saw this pre-requisites screen
My questions are:
(I think if i check SQL Server 2008 Express SP1 it will download it at client end) But I have SQL 2012 Express Edition Installed so how can I go with it ?.
Also is it possible If I give client seperate exe of my SQL 2012 Express edition ? (There is no need for management studio at clientside.so what should be given to client so it that installs only those software which are required to run .mdf file )

To answer your first question,
1. You will require a .prq file for SQL server 2012. Either you can create it or you can download it from web. You can add/edit '.prq' file from 'Redistributable' section.
For your second question,
2. You can pass the setup of aql 2012 express to your client with specific instructions to only install server and not the management studio.

You need SQL Server Compact most probably

Related

How to create a installer for C# windows application with SQL Server database integrated

I have a C# application that I want to install on my clients computers. It has a SQL Server database connection so that it can store data. I want to create a installer so than I can install the app on clients computer.
So far I tried Installer shield and advanced installer and I could not manage to pull it off.
NOTE: I can't install Microsoft SQL Server Management Studio on clients computer due to toughness.
NOTE: I'm using Visual Studio 2019 with Microsoft SQL Server Management Studio 2017 and .NET 4.5 and DevExpress and because I'm using DevExpress I have some reference files to copy to client directory.
If the users are not sharing their data with one another, you don't need SQL Server to begin with. There are other data storage options, ones that don't require an enterprise grade client-server database.
Your app can use a local database such as SQLite. You can use files - JSON or XML allow for easy parsing from C#.

How to deploy application to many users

I have got a C# .NET application which uses an SQL Server 2008 R2 database.
I have no problem deploying the actual application to multiple PCs, however I am having a whole world of trouble deploying the database. The application is going to be used by a large amount of users - it can be downloaded and installed by anyone. My problem is that the application uses a connection string to connect to the database.
How am I going to include the database as part of the installation using the Visual Studio publish tool, and make sure that it will work on any installation with the same connection string.
I have spent a long time searching, and have tried out many potential solutions, including this, however in the latter particular case, the application could not find the database when it was deployed.
As per your given SQL connection, it seems your are using Sql Server Express edition, to bundle express edition with your application, here are the options,
Add SQL Server Expression edition setup in your installation media, and invoke setup.exe through your setup program
Or you can use Web Platform Installer
Or you can simply check in your setup program, whether desired SQL Server Express Edition is installed, if NOT then display the message to user that "Please install the Sql Server Express Edition", and guide how he/she can install, for example providing a download link
Or you can go with Sql Server Compact Edition which is a light weight version and I think only few DLLs are required to make it functional on end user's PC.
For more information:
Sql Server Express Edition:
http://blogs.msdn.com/b/user_ed/archive/2012/12/09/how-to-embed-sql-server-express-in-an-application.aspx
Sql Server Compact Edition:
https://msdn.microsoft.com/en-us/library/aa983326(v=vs.140).aspx

Is it possible to run an application built on sql server 2008 to run with 2005

I have a .NET 4.0, SQL Server 2008 application built on VS 2010.
Since more than 10 months I have been working on a project and its completed now. I moved to the next task of creating an installation of the software. Its also done. But now I have a big issue.
My clients already run software running SQL Server 2005 and its installed on their system. However when I was packaging my VS2010 C# application, I deployed it with prerequisite of SQL Server 2008 but now the problem is, when I try to install my application, it asks to uninstall the 2005 and then to install 2008. But my clients are very rigid to allow my program to uninstall any application on their system. I am stuck here.
I also tried to remove it from my prerequisites and the application was successful to install itself but after when I tried to run my application, its unable to access the database.
How I can solve this issue? Is there any way to make application and database both work with SQL Server 2005 or 2008. Or maybe any other expert advice.
EDIT 1
I also have Datetime stuff which really annoyed with to accomplish, as my project is multilingual so I have separate functions to handle datetime to insert in SQL.
EDIT 2
Is it possible to upgrade SQL Server 2005 to 2008 using my own Visual Studio Deployment Project?
EDIT 3
This is the error I am getting
Prerequisite check for system component SQL Server 2008 Express failed with the following error message:
SQL Server 2008 Express Service Pack 1 (x64) cannot upgrade the existing instance of SQL Server 2005 Express (x64 WoW) named 'SQLEXPRESS'. Uninstall this instance of SQL Server 2005 Express and retry installing SQL Server 2008 Express Service Pack 1 (x64)."
See the setup log file located at 'C:\Users\BOOGI~1\AppData\Local\Temp\VSD41A1.tmp\install.log' for more information.
EDIT 4 (Main)
Is it possible to make a Microsoft SQL Server database file compatible to run with both SQL Server 2005 and SQL Server 2008?
It is usually not a problem to run an application against any version of SQL Server. Create the database using Management Studio and you're ready to go.
If you have a setup, you may need to change the prerequisites, so that it works with SQL Server 2005.
You may have to adjust the connection string. In the error message you're providing, it is obvious that the instance name of the SQL Server is "SQLEXPRESS", so you need to add this in your connection string.
Also, it is not a problem to run SQL 2005 Express and 2008 Express side by side.
One thing you can do is install SQL 2005 in your development machine or another machine then migrate your schema's and data from SQL Server 2008 to SQL Server 2005 and get your C# application working again. .NET 4.0 doesn't care which version of SQL server you are connecting to as long as you have the appropriate drivers installed for each appropriate database.
For your datetime create a function in SQL server so that it works in both version. Check out some examples in this link.
Thanks,
Kalagen

Can I create and connect to a SQL Server CE database if SQL Server 2005 isn't installed?

Is there any way to do this?
Update: Sorry, I should have included more information. I am trying to create and connect to a SQL CE database using System.Data.SqlServerCe in C# running on a PC (i.e. not running on a Windows Mobile device).
This code:
string connstr = "Data Source=\"" +
filename + "\";Persist Security Info=False;";
System.Data.SqlServerCe.SqlCeEngine engine = new SqlCeEngine(connstr);
engine.CreateDatabase();
... works fine on any PC that has SQL Server 2005 installed, but fails on any PC that doesn't have it installed. I'm trying to find out if there's any way to get this to work without installed SQL Server 2005 on the machine.
You can do it with Visual Studio - when you add a connection, change the data source from Microsoft SQL Server to Microsoft SQL Server Compact 3.5.
Also, if you mean the actual server - as opposed to the management tools - then SQL Server 2008 Management Studio [Express] can open SQL CE databases directly.
Edit: To create the database in Visual Studio, choose "Local Database" when you go to add a new item. That's a SQLCE database. And in SSMS[E], when you choose the SQL Server Compact option, you can choose "New Database" as an option in the Database File drop-down.
Edit2: In order to have code written against SQL CE run successfully on a vanilla target machine, you will need to install something on it, although not SQL Server 2005. SQL CE is a separate product (download page). It should also appear as a redistributable module in Visual Studio if/when you create an MSI installer for your product.
I assume that what you mean is can you create one with a tool, rather than with code. Studio can create them just by going to the Server Explorer and adding a new connection (you'll get the option to create one).
If you're looking for something a little nicer or something that doesn't require Studio, then Primeworks' Data Port Console is a really nice tool.
EDIT
If you need to create it through code then yes, you can still do this without Server installed. Make sure that you have the SQL CE Redistributable binaries (for the proper 32/64bit) deployed to the target and in a place the app can find them.
See locally at
C:\Program Files (x86)\Microsoft SQL
Server Compact Edition\v3.5
or online.
Just to add to what Aaronaught was saying, to connect to a SQL CE database programmaticaly, you don't either need SQL Server installed. CE runs in proc, and as long as the SqlCE dll's are installed (their part of the framework nowadays) then you should be able to connect to it without any issues.

What Order to Deploy .NET Application with SQL Server 2008?

I have created an Windows application.
I used
FRONT END : C# (VISUAL STUDIO 2008)
BACK END : MICROSOFT SQL SERVER 2008
.NET FRAMEWORK : 3.5
Now after deployment when I am installing the application in my Clients machine is it necessary to first install .Net Framework, VisualStudio2008 and Sql Server 2008 before installing Application?
And in which module of building my set up file(FileSystem Editor, Registry editor etc..) should I attach the DataBase?
This is my first application of deployment so please help me out with tips and tracks for deployment?
Thanks in advance!!
You customer will not use Visual Studio, so you don't need to install it.
You will need to install SQL Server manually. You cannot have your setup project install it automatically. Just install SQL Server 2008 (SP1 or higher). I believe this will install all or most of .NET 3.5 for you. If not, then when your setup is run, it will install any other parts of .NET that are needed.
BTW, be sure to test the installation steps on a clean system of your own (maybe on Virtual PC) before trying it on your customer's site!
It depends if you want every client to have SqlServer installed locally (usually, on an Enterprise scenario, you have already a server box with Sql Server running, and you just need to deploy your database there).
If having Sql Server running locally is a requirement, you might want to take a look at this thread which will help you: How to install a custom desktop application database to SQL Express?
You should install SQL Server manually before installing your application.
You just need to install you application, you do not need visual studio. If you use a setup project to do this it should detect that it requires the .Net framework and give the user the option of installing it.
You don't have to install the Visual Studio. For running .Net applications, you only require .Net Framework. And for SQL 2008 also .Net required. And for Database, either you have to run SQL Script or you may need to restore the database. Running SQL Script is better I think, you can do it via a Batch file.

Categories

Resources