Install a SQL Server database to a client's machine - visual-studio-2010

I need to install a SQL Server 2008 database on several user machines. The users are not technically proficient, so I cannot create a script and just give it to them. I need to be able to create an executable that will create the database. The executable will check if the user has SQL Server 2008 Express installed, then install the database. The executable will install the database using Integrated Security, so I don't need the user's id or password.
I tried using the database project in Visual Studio 2010, but it just creates scripts.
Is there an open source solution to creating an executable that installs SQL Server databases?

May I suggest that you look at embedding SQLServer 2008 Express within your application.
Check the Microsoft link here.
Then you can check for an SQL instance and install one if it doesn't exist when the program first starts up.

A simple way would be to use SQL Server Management Objects (SMO) to create a .NET console application that creates the database.
Depending on your security rights on your user's machines you may be able to run the app from your workstation and deploy directly to their machines.
SMO can also be driven by powershell.

Related

VS 2013 Setup Projects Works on one server and does not on another

We recently migrated from VS 2008 to VS 2013 including a set of setup projects. One of the setup projects is meant to install a web application. It has one custom action that is meant to check the connection to the database. The code of the custom action has not been touched during the migration and the .msi works perfectly when generated from VS 2008. When I built the .msi from VS 2013 it works perfectly well when installing on our local development server, and throw an error saying that it cannot connect to the db when rolling out in the clients environment.
I'd really appreciate if anyone can point me into direction of search here. I know that I'm passing a correct connection string, and .msi generated from VS 2008 can connect to that db from the same server.
Visual Studio custom actions that are installed for Everyone will run with the local system account. Connecting to a SQL DB will often fail because the DB doesn't allow the system account to connect, or because the DB is on a network share and the system account has no network privileges.
So it could fail because of the security settings of the DB or because the DB is on a network, and it may be nothing to do with the server. It might also connect if the install runs with a Just me setting because the custom actions then will run with the installing user's credentials. There may also be issues with architecture because servers are 64-bit and the 32-bit subsystem is optional, and you didn't say whether you install was x64 or your custom action code.

Is there an easy way to distribute the Access Database Engine

I'm using an Access Database (accdb) with my VB 2010 Application
I know I need to install the Access Database Engine on each workstation that needs to run my program.
However, I can see a logistical nightmare if I have to manually install the Access Database Engine on 100+ workstations manually.
I know a MSI doesn't exist. I'm looking for a solution to automate the installation of the Database Engine when the software installs.
Has anyone else overcome this problem.
If your application does not use any database features specific to the .accdb file format then you could greatly simplify matters by using an .mdb file to store your data. You could target your VB.NET project to the x86 (32-bit) environment and have it use the Microsoft.Jet.OLEDB.4.0 provider that is included with every Windows install. That way you could just distribute your app without having to worry about installing ACE.

Create setup file with SQL Server database in VB2010

I made a demo project in vb2010 using database interaction with SQL Server 2008 R2. Created a setup file for that project and installed and executed successfully on my PC. Copied that setup file on another PC and tried installing. But couldn't run it because SQL Server 2008 R2 was installed in that PC.
My question is that how can we create a setup file with database so that we need not install SQL Server 2008 R2..? Because, let's assume that I am developing a software for my client. What if my client doesn't have SQL Server installed on his PC? It will be useless to install the whole SQL Server for a small application. How can we achieve that?
It will be useless to install the whole SQL Server for a small application.
That's exactly right. Sql Server is not intended for use as a private data store for a single-user desktop application. If that's what you want, you can use Sql Server Compact Edition, Sql Server LocalDB, Sqlite, or even ~gasp~ MS Access. But don't use the full edition of Sql Server; not even Sql Server Express Edition. The full version of Sql Server is just that: a server, intended for use in a shared environment where you have many users talking to the same data source.

Software Installer package with database integration issue

Recently by using Visual Studio 2013 I have developed a program that displays alarm information based on its time and alarm tone settings. Those settings and files are stored in MySQL database.
The issue is:
Is there any way to install this application to another computer without requiring to export the database, install MySQL database and configuring it.
Just I want to Install the required database file and application at ones including to the Software installation package. or what you will advice me.
Using the Installshield Lite packaged with VS2013 you can create a setup that will include the setup of applications such as MySQL.
When the setup runs, it will install MySQL with the parameters provided. If you configure the application to use silent install as discussed here: https://dev.mysql.com/doc/refman/5.1/en/windows-installer-msi-quiet.html then the installation will be seen as 'part of' your setup.
For the settings, I would recommend creating a setup application (console app) that will read a .sql file etc and configure the database. This too can be run as a pre-requisite of your installation.
You can also do this all manually (i.e. write your own setup application that will call MySQL setup using Process class, install MySQL, create project folder, create shortcuts etc). The Installshield is not fully functional and a gets a lot of bad press, but will do the job for a quick/simple install.

Quick deployment of Visual Studio 2010 app with SQL database

I am new to Visual Studio 2010, so please bear with me. Back in the days of using VB6 combined with an Access database, all I had to do was to use the Package & Deployment wizard and include the database file in the setup. Then all the client had to do was run one setup file and the application would magically run right away (the database would be placed in the App Path).
Is there some way to create a setup file in VS 2010 which will also install SQL Server Express automatically, attach the database along with the application itself?
This is meant for people who do not have SQL server installed and they should be able to start using the app by running one single setup.
Thanks!
Yes, your setup based on Windows Installer and built with Visual Studio itself can deploy everything you need. Read this article on MSDN for more details (maybe you won't need ClickOnce but it contains a lot of links).
I guess you need some clarification about your options (I assume you want to use a Microsoft solution because you talked about SQLExpress).
Microsoft SQL Server: fully featured database engine. It costs (a lot) and deployment isn't easy as we would.
Microsoft SQL Server Express: free edition (with some limits) of the big brother. Same installation issues. Perfect for medium desktop or web applications.
Microsoft LocalDB: single or multiple file, single user, support for stored procedures and advanced data types as in higher versions, easy to deploy and (optionally) per-user execution. Perfect for small/medium desktop applications and developing (with some preconditions with web applications too).
Microsoft SQL Server Compact 4.0: single file, single user, small, in-process, very easy to deploy. Perfect for small single user applications or used as local data storage (VS2k10 C++ Intellisense, for example, uses a SQLCE DB).
Microsoft JET Engine: the old beloved Access. If you come from VB6 I guess you know this.
If (and this is a big IF) your application is intended for a single user and you don't need data-sharing, now Microsoft provides a new version of SQLServer Express called LocalDB.
This version runs as standalone executable (isn't a service).
Its major advantage is the easy installation.
Search for LocalDB or look at my question LocalDB deployment

Resources