Jump to content
xisto Community
Sign in to follow this  
innosia

How To Install Sql Server Express In Package Deployment With Different Instance Name

Recommended Posts

.NET programmer can easily build Setup and Deployment package using existing wizards in VS 2005 or 2008, thus when the setup.exe is run in client, it detects that whether SQL Express is installed or not on the system, and it can install it if requires. The fact is, programmer does not have any options such as

- Changing the database instance name, the default instance name is SQLExpress and cannot be changed (it is restricted)
- Cannot change the SQL user and password
- Thus this makes SQL Express application hard to be configured automatically, and it causes programmer must do some manual configuration.

In this Tutorial, I have a class name BusinessSQLEXPRInstaller, to use it as installer
- First build your windows form application and add app.config entry
<appSettings>
<add key="IsInstall" value="0"/>
<add key="IsRestart" value="1"/>
</appSettings>

Add both isinstall and isrestart key in app.config, and let the value like that as default

in your windows form, there must be a start up form, in this start up form constructor add
JohnKenedy.BusinessSQLEXPRInstaller _ins = new JohnKenedy.BusinessSQLEXPRInstaller("<Installation Display Name>", "localhost", "<New database instance name>", "<new database name>", "<database password>", "<database backup filename>");
if (_ins.IsDone == false) _ins.ShowDialog();
if (_ins.IsRestart == true)
{
Application.Exit();
this.Close();
return;
}

Change <..> to match with your value.

- After your project is ready, create setup and deployment application
- Then Download SQL Express for free at http://forums.xisto.com/no_longer_exists/
- use command line to go to the exe folder and type : SQLEXPR32.EXE /x
- nows all the files contain in exe resources, will be extracted, and add these extracted files into your Setup and Deployment Application Folder\SQLEXPR2005 folder (create this new folder)
- add your database backup filename (for example mydb.bak which is created from SQL Server Enterprise manager or management studio) and put it in this folder too
- Build your setup and deployment project

The resulted setup.exe now includes the SQLExpress that can be installed by your application using BusinessSQLEXPRInstaller class.
This helps you automate several things
- restore your database to the client without user configuring
- install the database engine without user knowing
- as developer you know the database engine username and password and can be controlled by you as developer
- User does not need to know programming languages, they just click and install, and no need to understand how to setup your application to connect with the database.

Share this post


Link to post
Share on other sites
vb.net db sql projectHow To Install Sql Server Express In Package Deployment With Different Instance Name

dears How can I create a setup file in (VB.Net SQL 2005 database project), without installing sql server on another PC and running the program.

thanks,

-reply by Wura

Share this post


Link to post
Share on other sites
can we use sqlserver database without using serverHow To Install Sql Server Express In Package Deployment With Different Instance Name

My dear friends,

I have developed an application using visual basic as front end and sql server as Back end. How can I create a setup file in (VB SQL server database project), without installing sql server on another PC and running the program.

thanks,

 

-question by ghulam haider malik

Share this post


Link to post
Share on other sites
Bravo!How To Install Sql Server Express In Package Deployment With Different Instance Name

Congratulations on being the first person willing to talk about how to deploy the actual database. Everyone else tells you all about how to get SQL Express to install, but surely a new database for your application, without the users having to know anything about databases, servers etc (most don't know the difference between the data and the program let alone the client and the server).

Thanks.

-reply by Stuart

 

Share this post


Link to post
Share on other sites
answer How To Install Sql Server Express In Package Deployment With Different Instance Name

use connectionstring in your VB application..And make a .Ini file for the connection and other initialization variables..Email me for other more info...Isagani_quino@yahoo.Com

-reply by Isagani

Share this post


Link to post
Share on other sites

.NET programmer can easily build Setup and Deployment package using existing wizards in VS 2005 or 2008, thus when the setup.exe is run in client, it detects that whether SQL Express is installed or not on the system, and it can install it if requires. The fact is, programmer does not have any options such as
- Changing the database instance name, the default instance name is SQLExpress and cannot be changed (it is restricted)
- Cannot change the SQL user and password
- Thus this makes SQL Express application hard to be configured automatically, and it causes programmer must do some manual configuration.

In this Tutorial, I have a class name BusinessSQLEXPRInstaller, to use it as installer
- First build your windows form application and add app.config entry
<appSettings>
<add key="IsInstall" value="0"/>
<add key="IsRestart" value="1"/>
</appSettings>

Add both isinstall and isrestart key in app.config, and let the value like that as default

in your windows form, there must be a start up form, in this start up form constructor add
JohnKenedy.BusinessSQLEXPRInstaller _ins = new JohnKenedy.BusinessSQLEXPRInstaller("<Installation Display Name>", "localhost", "<New database instance name>", "<new database name>", "<database password>", "<database backup filename>");
if (_ins.IsDone == false) _ins.ShowDialog();
if (_ins.IsRestart == true)
{
Application.Exit();
this.Close();
return;
}

Change <..> to match with your value.

- After your project is ready, create setup and deployment application
- Then Download SQL Express for free at http://forums.xisto.com/no_longer_exists/
- use command line to go to the exe folder and type : SQLEXPR32.EXE /x
- nows all the files contain in exe resources, will be extracted, and add these extracted files into your Setup and Deployment Application Folder\SQLEXPR2005 folder (create this new folder)
- add your database backup filename (for example mydb.bak which is created from SQL Server Enterprise manager or management studio) and put it in this folder too
- Build your setup and deployment project

The resulted setup.exe now includes the SQLExpress that can be installed by your application using BusinessSQLEXPRInstaller class.
This helps you automate several things
- restore your database to the client without user configuring
- install the database engine without user knowing
- as developer you know the database engine username and password and can be controlled by you as developer
- User does not need to know programming languages, they just click and install, and no need to understand how to setup your application to connect with the database.


but i dont understand that how to add constructor and ur BusinessSQLEXPRInstaller ?please tell me as soon as possible

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.