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
 11-Copy the SQL Database Script Code and past it here
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”

 This error will appear to you and inform you that your database already exists so the setup will not complete .remember that your PC already contains this database so it’s logically to get this error but if you want to test your deployment you must delete the database from your SQL Server and then you can install your program successfully.


Now you can run your exe again without that error .


 And this is our program desktop shortcut


 
Thanks


14 comments:

  1. hi , i like your guide on advance installer and sql database, pls i need your help. my question is, in the add package prerequisteand sql server express available, but sql server enterprise is not there. and my database server is in sql server enterprise 2014, what should do.or should i still use sql express prerequiste and dot net framework for my projct setup creation , Thank u sir

    ReplyDelete
  2. How would you install sql server silently without an interface?

    ReplyDelete
  3. Advanced Installer Architect Crack
    I am very impressed with your post because this post is very beneficial for me.

    ReplyDelete
  4. Thanks for sharing the crack but you need to update this version because here new version Available below;

    https://licensedinfo.com/advanced-installer-crack/

    ReplyDelete
  5. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me.
    Advanced Installer Crack

    ReplyDelete
  6. It is amazing and wonderful to see your blog. Thanks for sharing this information,..
    advanced-installer-architect-crack

    ReplyDelete
  7. I really appreciate the kind of topics post here. Thanks for sharing us a great information that is actually helpful. Good day! Advanced Installer

    ReplyDelete
  8. I'm really impressed with your writing skills, as smart as the structure of your


    Latest Software Free Download



    weblog. Is this a paid topic



    Ecd audio converter crack



    do you change it yourself? However, stopping by with great quality writing, it's hard to see any good blog today.



    Anytans -crack





    Winrar -crack





    Snooker pro -crack





    advanced installer pro crack



    ReplyDelete
  9. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost

    the past 2 years, but I had no idea of solving some basic issues. I do not know how to

    Download Cracked Pro Softwares
    But thankfully, I recently visited a website named cracksoftwarefreedownload
    All Pro Cracked Softwares Download
    PCexe.org
    Windows 12 Pro Crack
    Adobe Photoshop Lightroom CC crack
    Program4pc Video Converter Pro crack
    Advanced Installer Architect Crack

    ReplyDelete