deploy SQL Server Express database with desktop app? - sql-server

I've created my first database based desktop app in .NET and not able to understand how can I deploy the database with the application installer, so that the database, application and the SQL Server is installed in one go.
If I only deploy the native client for SQL Server and the database with the installer, will it work?
The application uses the database very frequently.

You need to install the SQL Express engine if you want to use it. Deploying only the client connectivity will give you exactly what the 'client connectivity' name implies: you'll be able to connect to a SQL Server. But only a running SQL Server instance will be able to read/write your application database.
The SQL Express install MSI is actually very customizable and allows for a lot of scenarios, including unattended setup and remote deployment. For the most basic options, see Configuring SQL Express During Installation. Your application installer will have to invoke the Express installer passing in the desired parameters.

Using click once you can make sql server express a dependency of the main project and it would be deployed with the instalation data and installed, if it is not instaled yet, when you first install your app.
You can do it in the project properties, in Visual Studio.

Related

How can I install the default Microsoft SQL Server that comes with VS22?

On my PC, I messed up the default installation of the SQL Server that comes with VS22.
I managed to install SQL Server manually again, but I have to write a database class library using EF Core.
For that I have a connection string as follows:
Data Source=(localdb)\\MSSQLLOCALDB;Initial Catalog=TestDB;Integrated Security=True
I've been told that EF will create the database as needed after the name given in the connection string.
This works fine on my new laptop on which I did not touch the SQL Server. On my PC it does not work though.
What do I have to do to get the "default" installation of the SQL Server?
You can install LocalDB through the Visual Studio Installer, as part of the Data Storage and Processing workload, the ASP.NET and web development workload, or as an individual component.
The steps in Visual Studio Installer are as follows:
First select Modity, then select SQL Server Express LocalDB in Installation details. Hope it helps you.

how to deploy database along with desktop app created on visual studio?

I've created a desktop application using visual studio'10 and it uses a database.How to deploy the database along with the app so that users who don't have SQL server can also access it?
The application is not at all web based.Is there any way other than installing sql server on client's system?

Cube Deployment failed in BIDS

So I've been doing a project at my university with BIDS and a database on their servers. I've managed to back up the database and put it on my local machine.
Problem right now is I've installed SQL Server 2008 + BIDS through SQL Server 2008 Express Edition. Now I've heard it doesn't include SQL Server Analysis Service, meaning I can't deploy the cube.
I've tried deploying the project on my home computer but it gives me the error.
Error 23 The project could not be deployed to the 'my computer
name\SQLEXPRESS' server because of the following connectivity problems :
A connection cannot be made to redirector. Ensure that 'SQL Browser' service
is running. To verify or update the name of the target server, right-click on
the project in Solution Explorer, select Project Properties, click on the
Deployment tab, and then enter the name of the server.
I've checked and SQL browser service is definitely running so I'm not sure what else to try. Is there any way for me to successfully deploy the cube?
I think its authentication issue for your current user connecting to SQLEXPRESS. Try using "Runas /user:[domain]\[user] "Path to BIDS" to run BIDS as privileged user and try windows authentication.

SQL Server Analysis Services and Team Foundation Server

I am attempting to setup Team Foundation server, however I am running into a problem regarding SQL Server Analysis Services.
The installer gives a warning saying that Analysis Services is not running. Analysis Services was installed when we installed the version of SQL because we do have the Deployment Wizard etc, however there is not a service showing in the services window that is running.
I tried to run the deployment wizard but it wants me to specify what database to connect to, and I can't create a database because I cant connect to analysis services.
There appears to be something fundamental that I am missing here, if anyone could give me guidance I would much appreciate it.
The AD account you install and configure TFS 2010 with has to have administrative privileges in the AS cube. You should be able to connect to it using SQL Server Management Studio. It needs these privileges during configuration to create and setup the cube.
How did you install SQL? Try tossing the SQL Install disc back in and install Analysis Services if it's not already present.
If you installed SQL Express as part of the TFS Install, then you don't get Analysis Services or any TFS features that depend on it (reporting).

Problem with deploying an application that is using sql server 2008 express

I've developed an application for my college project in Visual C# which uses SQL Server 2008 Express database. My application is desktop-based. But the problem now is deploying the application. Is it required that a SQL Server 2008 be installed on the client machine (with my tables and data inserted) or can I just have the .mdf file exported and everything works well?
Is there a way to escape the installation of SQL Server 2008 on the target machine?
Sorry, just found a duplicate: Does user need SQL 2008 Express Installed if I deploy app with .mdf file?
You can deploy SQL Server Express with your application. However, most of the time this is just the wrong thing to do. SQL Server Express is a server-class database, and likes to use up system resources as such. It also runs as service, which means it's using those resources even when your application isn't active.
Instead, you should choose a desktop (or in-process) class engine, like SQL Server Compact Edition, Sqlite, or even MS Access. In addition to being an all around better choice for your desktop program, these database will also generally be much easier to deploy.

Resources