Forgive me if this is not the correct forum for this ask but I have a c# application that uses SMO to setup a database on a remote server. I am wondering how to deploy this application as it works fine on my dev server but when I deploy it is missing batchparser and batchparser.client.dll files. They exist in the bin folder and I have referenced them by installing the Microsoft.SqlServer.SMO nuget package.
According to the official documentation:
Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.
This is a replacement for SharedManagementObjects.msi, which was previously released as part of the SQL Feature Pack for each release of SQL Server. Applications that use SMO should be updated to use the NuGet package instead and will be responsible for ensuring the binaries are installed with the application being developed.
I would assume this to mean I should be able to install the nuget package and all should be referenced correctly. Am I missing something big here? Does SQL Server need to be installed on the machine I am running my C# application from?
My architecture is as follows:
Web server
SQL Server
Web admin logs into (1) web server and runs my c# program which sets up some IIS based .net websites on that machine, then from the web server it will REMOTELY setup a database by running the smo commands. The C# program will execute the commands on the web server and remotely configure a SQL Server (2)(another machine).
Can this be achieved using C# and SMO without having an instance of SQL/SQL tools on the web server?
Thanks
Related
I have a desktop app developed in C# with SQL Server and I want to deploy the app on client Machine.
How to compile the app into setup files?
I have SQL Server Express installed on client machine.
When you compile the app you will need to have the connection string to the database that exist on the client machine. Also ensure the correct tables and what not are in there too. You can compile the app for release by right clicking the solution and then clicking publish. You can then publish a release version for production that can be used on client machines.
You will have to do this for every client machine.
Some options to make this easier might be as follows:
Create a shared instance of SQL Server that all clients can connect to
Use a nosql solution like litedb or something else.
Store the data locally in another fashion.
Hope this helps! Leave comments if you are confused on anything.
I'm trying to learn how to create a simple application using Visual Studio IDE in C#.
I wrote a little application that uses a local SQL Server database for reading and storing data. On my machine, the program seems to work normally, but when trying to install the application on client computer it seems unable to read from the database.
I've tried to include the following prerequisites to the publish properties but it doesn't work:
Microsoft .NET Framework 4.5.2
SQL Server 2012 Express LocalDB
Any ideas about the right way to do it?
Thanks to all.
You need to install SQL Server Express LocalDB (SqlLocalDB.MSI) on the computer you are deploying your ClickOnce application to.
Selecting "SQL Server Express LocalDB" in the Prerequisites window and using "Download prerequisites from the component vendor's web site" should take care of that:
If you do that it should install the LocalDB for you and any database errors are more than likely resulting from connection string errors or leaving Integrated Security enabled.
You need to test on a target computer which does not have "SQL Server Express LocalDB" installed and verify that after the ClickOnce deployment it is installed. This will confirm that the problem is not the missing prerequisites but the database access issues...
We have developed SSIS packages in SSDT, and our database is SQL Server 2016 Express.
Is there any way we can execute our SSIS packages on SQL Server Express, as our client machines will be using SQL Server 2016 Express. Can it be through C# application, so that we can create a console application, or windows service?
As the comments attest, no - you cannot.
SQL Server Express only allows access to the Import/Export Wizard (which creates and immediately executes an SSIS package. You cannot persist the package you created nor could you run an existing package).
Running an SSIS package outside of the development environment (BIDS/SSDT) requires that the SQL Server Integration Services Service be installed on the machine.
The only way to get the bits for the SSIS Service is to have a licensed copy of SQL Server (not Express edition). That's going to cost you ~ 8k per core for Standard edition or 21k per core for Enterprise edition.
Do not attempt to copy all the required DLLs and registry keys to the client computers. That will result in them being in violation of licensing with Microsoft and they really like getting their money.
I wanted to create a desktop application with database, am using Visual Studio 2013 and C# , Can anybody suggest me what server I used to create my database, in order to run my application in my client's system locally with out installing any database server in client's system [ie, with out installing MsSql server or MySql server or Acess], I want my app works properly when installing my own application's exe file ?
And Now am using MSSQL server with my application , Is there any way run this application in client's system locally with out installing MSSQL Server? [my application front end works when I install .Net FrameWork 4.5 , I need something like this for my .mdf databse in Sql Server]
somebody says about SQL Server Compact ,but i don't know how to use it
You can use SQL Server Compact, which can either be installed separately or deployed as part of your application.
See here: How to deploy SQL Server Compact Edition 4.0?
And here: https://msdn.microsoft.com/en-gb/library/aa983326(v=vs.110).aspx
Your DB code in your app - apart from your connection string - should not need to change as you're already using some version of SQL Server.
There is also SQLite, which is as far as I know is well regarded, but I know very little about it. http://www.sqlite.org/
Hope that helps!
It is not unusual for an application to require an existing functional database server. Of course this is appropriate only if your target audience is technical enough to install the prerequisite on their own, or if the target environment is guaranteed to already meet your prerequisite.
If not, you need to fall back to an embedded database.
I create project in Visual Studio. My app use .mdf files. I created a setup project using InstallShield. On my computer where I developed my app, setup works just fine!
But when I install app on another machine I get an error
you need install SQL Server Express
How to embed SQL Server Express into my setup project?
You need to install SQL Server on your computer, Visual Studio can not embed this. Go to https://msdn.microsoft.com/en-us/sqlserver2014express.aspx, download and install. I'm not sure if you can get it without a Microsoft account.
By using .mdf you got a dependency on SQL Server Express (at least). You might want to pack your database to a server and have your app just use client libraries or you could switch to SQLite or something with less footprint.
Also take a look here how to bundle your setup with SQL Server Express:
Can I deploy SQL Server Express with my desktop application just like builtin database?
Visual Studio publishing tool can do that. If you're required to use InstallShield, there's a guy who ensembled a video guide: http://www.installationdeveloper.com/3356/how-to-install-sql-server-2008-express-r2-in-installshield/