publishiing of vb.net application with setup procces - vb.net

how can i keep the sqlserver install automatically when i install my project with attached my own database to sqlserver 2008 express after publish my project. what is the code i can write to in the setup project under vb.net to keep this happened thanks a lot

To get it to install Sql Server Express, just tick the appropriate box in the prerequisites screen as described here.
To attach your db look at this article for various ways of doing it: Detaching and Attaching Databases
I think the recommended way is to use CREATE DATABASE FOR ATTACH

Related

vb.net and sql database application installer

Bit newbie to this but, I am trying to develop an application with vb.net and sqlexpress. My application works perfect it connects to database and shows data on datagrids and all. Now, i wanted to install this application on another computer..... so i added .net freamework and sql express 2012 in prerequisites and have added set up project to main project as well. when i built setup and used on another computer, installing process works with no errors but it does not install sql express at all. thus application does not work. I have seen lots of pages related to one click install with prerequisites and applied solutions but it seems it just does not work.
Any help is greatly appreciated.

How to deploy vb.net project with SQL Server CE as database

I created a vb.net project and I used SQL Server Compact Edition as my database. Now I want to create an installer for it, for installing on different PCs.
Does it require to install Visual Studio on the client PC? How should I create installer which will include that database file?
Sorry for my bad English.
Please help.
Thank you in advance.
This msdn link shows how to do it:
https://msdn.microsoft.com/en-us/library/aa983326.aspx
There are 2 parts to it:
Deploy the database file. This can be done by setting the file to copy local always and updating your connection string to point to this.
Deploy the sqlserverce dll's. Follow the instructions in the msdn link which will copy the 7 dll's locally. This means you don't have to install sqlserverce on the individual pcs.

how do I install ssis on existing 2008 instance

Our current version of sql server left out ssis component how do I install it? I have tried to go through visual studio and there is no ssis toolbox or anything dealing with ssis.
Have you looked at the MSDN install instructions for SSIS?
Select Integration Services to install the Integration Services service and to run packages outside the design environment.
This answer provides a detailed way to find out if SSIS is installed and how to start the service.
Goto Control Panel\Programs and Features select your setup. Please note you have to select where Size of Setup is zero. Click on Uninstall/Change. Follow on screen instructions. On installation type select add features to existing instance.... select your instance. On subsequent screens if you don't know much about configuration then keep all to default values.

SQL DB Deployment

The scenario:
I have written a software application that includes an installer, that is to be used by Mr Layman to install the system on to a single computer.
The system is a simple C# winforms application with an SQL Express database. The target machine would be a standard installation of Windows XP with SQL Express and .NET 3.5 installed.
I am able to create the installer for the winforms app, that would check the version, create all the directories and copy over all the necessary executable's etc. I have also an SQL script that will create the database and populate it with the necessary data. However I do not know how to go about creating a stand alone installer for the database on the target machine.
I have an SQL script that will create the database etc, but how do I make the installer run this script? I've had a google and I don't really know what I'm looking for, can someone point me in the right direction please.
Thank you in advance.
Create a custom action in the installer project that will take your SQL script and run it against the database. Here's an MSDN link that covers the basics.
An installer which runs SQL scripts can be created in 2 ways:
The very hard way:
create an installation with custom dialogs which retrieve the SQL connection information
save that information somehow (in an MSI package you can use installer properties)
write a custom action which uses that information to connect to SQL Server and run your script
The easy way:
use a setup authoring tool which supports SQL scripts
If you want a free solution, I recommend WiX. It has a steep learning curve, but it does what you need.

Best practices or tools for installing a SQL Server database

Best practices or tools for installing a SQL Server database
I have a SQL Server database designed with the SQL Server GUI database editor/Visual Studio.
What is the best way to "install" that database on other systems. Said another way how should I ship this thing?
I know I can save the scripts and set the primary/foreign keys with T-SQL but I suspect their is something better. I guess you could have people restore from backup but that does not seem very professional.
What other choices are there and what are the pluses and minuses?
For it to look professional make a small setup program.
You currently have sql scripts that you use to create your db.
Make yourself a small xml file that contains the path to your scripts.
Create a small c# library that will connect to the db server, and run those scripts.
You can test this outside of the setup, in visual studio, then add it to the setup like this.
To do this from your setup all you have to do is put the xml file in a component so it is deployed,
And create a custom action in your setup, that will call your C# lib, read the xml and run the scripts on the sql server to create your db.
Also, from a setup program it's easy to set a registry key to identify the version of the your db that you just installed.
The minuses and pluses: It's a bit of work to start with, but with this you'll have all the ground work done to handle upgrades automatically later on, to do so, just add an upgradeScript section to your xml, an attribute called version for each upgrade script, and simply compare it against the version of the db you have save in the registry. The advantage is this way it can easily scale with your project.
My previous answer is mostly to keep full control on the deployment and upgrades.
I have searched for more built-in and streamlined solution that goes along with the DB designer mode you have used.
I found that in the version Studio 2005 Team Edition for Database Professionals of visual studio there might be deployment features.
Build and Deployment
You've seen that you can generate a
T-SQL update script manually via the
Schema Comparison tool. However, as
part of the build process, DB Pro
edition can generate a complete script
for deploying your database project.
This deployment script can do either a
complete build or an incremental
update. The build process can even
consolidate all of your pre- and
post-deployment scripts into one
complete deployment script. You can
deploy the script via the Build |
Deploy Selection command right from
within Visual Studio 2005. Under
project properties, you will find a
number of options to control and
adjust the build process. The Build
tab contains the core settings, such
as Target connection, Target database
name, and Block incremental deployment
if data loss might occur. You'll note
there is also a Build Events tab that
you can use to type pre- or post-build
event commands. DB Pro edition uses
MSBuild for its build process and
supports integration with Team Build
if you're using Team Foundation
Server.