Deploy application and database in WPF - wpf

I have a WPF application and it has a SQL Server database. All users of the application will be able to do the following:
Be able to install the application locally, and also the database (blank tables with no data) using a single click. Henceforth they will be able to run the application locally on their own machines. All the users have SQL Server installed on their machines.
Be able to get updates (or notification of updates) on the application and database, and will be able to install the updates if they choose to do so.
I realize that ClickOnce can do it for the application only. Now since I have the database along with the application, how can I do it?
Any help will be greatly appreciated.

If your users have the adequate permissions over their database (which I hope they have) you could simply check that the DB is ready at application Startup, and if not, run the creation scripts on it.

You can deploy an SQL Server compact database along with your application. Sample here: http://robindotnet.wordpress.com/2010/02/28/how-to-deploy-the-sqlserver-compact-edition-software-locally/
For SQL Server 2005 / 2008 the user must use the Microsoft provided installers.

Related

Using Microsoft SQL Server with Windows Forms application (vb.net)

Ever since I started vb.Net programming, I have been using MS Access as back-end for all my programs.
It is easy to publish application with the MS Access database and run it on another PC without installing the MS Access database.
But now, the project I am working on needs a database with high storage capacity which means MS Access is no longer an option and I have chosen to use SQL Server. Now my question is do I have to install SQL Server on any system that the application will be run on? If so, how will I copy the database that I created on my development machine to other system so that my application will connect to it? Or is there any simpler way of doing this?
SQL Server is a client/server DBMS so you only install the database on the shared server. .NET includes SqlClient, which provides the client components needed for SQL Server applications.
There are a number of options for database deployment. Although you could use restore or attach your development database for the initial database deployment, that won't work well for future upgrades (assuming you want to keep data). Consider using T-SQL scripts and/or SQL Server Data Tools (SSDT). That will allow you to create new databases, such as for development and testing, as well as upgrade existing ones.

Is there a way to deploy SQL Server Reporting Services without SQL Server?

I'm currently working on an application that runs a small SQLite DB, but I want to use .RDLC for reporting.
I generate the reports over my view models, the idea was for them to be decoupled from the DB, but now I run into this snag that I have to install SQL Server in order to use the reporting framework.
I wouldn't want to require my clients to install SQL Server on their machines just to be able to generate reports. They won't be happy about that. And I don't want to redesign my reporting component either(I have something from a previous project which used SQL Server and that works very well. I want to reuse it)
Is there a way to deploy the Reporting framework on the target machine without SQL Server?
Ideally I would like to just just copy the needed libraries in my application's installation folder, under OTS, but I don't really know which libraries to copy and what I can leave out or even if it's going to work this way.
Any insight would be helpful.
No. SSRS will only work on a machine with SQL Server installed on it.
Same with SSAS and SSIS.
So what we ended up doing is installing two nuget packages.
Microsoft.ReportViewer.Windows and Microsoft.SqlServer.Types
This will allow us to use the reporting framework without deploying SQL server on our target machines.

Standalone Database Option that works well with EF and is easily deployable?

I recently started a Winforms VB.NET application that uses a mysql database to store information. Problem is this is a standalone system no network access to the database is needed. And installing mysql server, along with the connector has become a great burden. Is there a viable alternative database engine that will be non-transactional, and EF still works with. This database just needs to keep up with client details, payment History, and related items..
SQL Server Compact might work for you, depending on it's limitations. If not, SQL Server Express will work fine

Deploy SQL Server Schema Changes using SQLCMD

I'm using Visual Studio Team System 2008's Database tools to develop my databases. On my local dev machine, when I want to deploy schema changes to the SQL Server instance on my machine, I just use the Data --> Schema Compare feature of VS2008.
But with live databases I can't do this because I can't connect to the database directly from my machine and the server haven't got VS2008 installed.
So I was thinking about the SQLCMD tool. Isn't that what VS2008 uses "under the hood"?
I want to use as part of an automatic deployment strategy. I want to be able to publish SQL scripts generated by VS2008 to the server and have an application run scripts on the live database to update the schema.
UPDATE
I'm trying to achieve automatic change script generation by taking the deploy script VS2008 Database Edition generates and comparing it against a live database. Only I want to do it through code, no tool or anything. It must be able to run from a Windows Service on the server.
SqlCmd would work. If you also want automatic versioning support you should check out Tarantino.Net, a database management tool that keeps track of which sql-files have already been run.

How to install a custom desktop application database to SQL Express?

I have a WPF desktop application that uses a custom database for storage.
I need to prepare a setup project (from Visual studio 2008) (full setup, not ClickOnce).
I can add the to the list of prerequisites to the application and it does install during the setup of the application.
My question is: How can I run a script during the setup to create the database that the application needs? OR how can I restore the database to the client machine during the setup?
Another related question, what would happen if already exists on the client machine? How to detect the instance name and connection data? And then how to be able -if needed- to change the Connection string used by Entity framework to connect to that database?
Thanks,
Ed
SQL Server Express Edition is generally a really poor choice for a local database. It's a server-class engine that likes to use a lot of resources and runs as a service (so it's using up those resources even when your app isn't running). In other words, it belongs on a server.
The only place I've seen SQL Server Express used on a desktop that almost makes sense is as part of the Microsoft Small Business Accounting app, and in this case you generally install that program on a machine who's primary purpose is doing the accounting for your business.
What you should do is use a desktop or in-process class engine like SQL Server Compact Edition, Sqlite, or even Access. This will also greatly simplify your deployment.
If you insist on pushing through with this, know that the installer will create a new instance of sql server on the system. SQL Server will be fine with this. However, you'll need to account for that in the connection string of your app, and that can be a little more complicated. Additionally, to set up the database you have a couple options:
Create it from client code on first start of the app
Create it with a custom installer action (hard to get right because msi permissions)
Distribute an pre-build *.mdf file and attach with custom installer action or on first start of the app.

Resources