Bitsologya
Tuesday, August 26, 2014
Sunday, August 24, 2014
How to use Advanced Installer to package SQL Database with your C# Application?
Hi , In this Article I will talk about deploying a C# project and automatic attach of SQL database .I will use Advanced Installer to perform that and you can download it from here
Here is the details steps:
1-Set up Advanced Installer
2-This is our project and Our Database
3-Generate the script code of the database
Right click on the database
name>>Tasks>>Generate Script
4-A new window will be opened
Click Next>>Check on the CheckBox of “Script All
object of selected database”>>next>>finish
And then a script code will appear
4-A new window will be opened
Click Next>>Check on the CheckBox of “Script All
object of selected database”>>next>>finish
And then a script code will appear
5-Now we are ready to open the Advanced Installer and begin
to deploy
Click ok then Next
Click next>>next>>finish
Then customize the application data like name, icon and so
on
6-Now we will package the SQL Express and the Dot net Framework
7-Now we will attach Our SQL Script Code that we generated
before
8-Customize some properties like in this photo
9-now we will add a create statement to create our database
when we start to install our program
10-Now we will add the SQL Database Script Code that we
generated before
12-Here the Creation and script code of database will
perform in the start of the installation
But I want to add drop statement to run when the user wants
to uninstall the program to drop the database .so I will add another SQL Script
that contains the drop database statement and I will name it “Drop database”
13-Now all sql codes are attached and we now ready to click
run project to generate the Executable file “.exe or MSI”
Click ok then the installer of your program will start
Now you finished deploying your own project but something will occur that could make you upset but I will say to you “Calm down Man :D”
Now you can run your exe again without that error .
And this is our program desktop shortcut
Thanks
Subscribe to:
Posts (Atom)