I've a winform application that intreacts with MS sql server for database. How can I deploy the winform application in any computer and make it runnable ? I'm not clear on how can we deploy sql server database to the client computer and make the application running.
You can convert to SQL Server LocalDB (https://msdn.microsoft.com/en-us/library/hh510202.aspx), which basically involves a changing your connection string and then deploying a copy of the .mdf file with your application. LocalDB will need to be installed on the user's computer.
MsSql Server has several editions with different constraints and requiring different configurations (https://www.microsoft.com/en-us/sql-server/sql-server-editions).
If you focus on standard, developer, enterprise, or web edition of MsSQL Server,
You need to deploy your database to a separate db server as a best practice, and your application connects it remotely by appropriate using connection string.
If you will use Ms Sql Express edition which you can deploy your database with your application together; in addition, you can prepare an installation package and attach the db to that installation process. You should keep in mind that Express edition has limitations such as storage.
If your applications is not stuck with Sql Server, you can take a look at alternative standalone databases such as sqllite. You can follow the thread for the details (Alternatives to SQLite?)
Related
I'm writing a program with using C#. And I'm using SQL Server Management Studio to create local databases to keep my data. I would like to run this program on other computers. I do not want to install SQL Server Management Studio on every computer. Can I move my local database to other computers without installing SQL Server Management Studio?
In example I don't mind installing localDB. Actually I think that I can do it only using localDB but I could not find proper info. My program can reach the database with connections.
In other words, how can I move my database to another computer which ONLY has localDB?
Thanks...
From Microsoft:
LocalDB is a feature of SQL Server Express targeted to developers. It is available on SQL Server 2016 Express with Advanced Services.
LocalDB installation copies a minimal set of files necessary to start the SQL Server Database Engine. Once LocalDB is installed, you can initiate a connection using a special connection string. When connecting, the necessary SQL Server infrastructure is automatically created and started, enabling the application to use the database without complex configuration tasks. Developer Tools can provide developers with a SQL Server Database Engine that lets them write and test Transact-SQL code without having to manage a full server instance of SQL Server.
You can work with LocalDb without having to install Management studio.
I have created a Billing Software using windows forms and sql server 2012.
Now i'm very confused over many things regarding database connectivity.
After making exe file, for installing in client machine i have to install sql server in client machine and configure the database then install my application.
My doubt is.. is this how this procedure works? I downloaded some billing software from internet and how they work without configuring a database? and which is the best practice? should i install sql server in client machine ?
If you just want a single standalone database per instance of the application - specific to the computer installed on - then you have a few options.
SQLite - https://sqlite.org/
SQL Server Express LocalDB (this is the 2016 version) -https://msdn.microsoft.com/en-us/library/hh510202.aspx
Both of these run stand alone databases that can be embedded into your program using visual studio. There are others, but these are the ones I'm familiar with.
Syntax for SQLite has some differences to its syntax (mostly package specific) however SQL Server Express LocalDB runs the same T-SQL as the standard SQL Server package
You do not have to install SQL Server on the client machine. The clients connect via network to the central database using some database client drivers.
Assuming that you are using ADO.NET then you have configure the clients somehow to use the right connection string, where server name, database name etc. is contained.
I have a simple web application that accesses tables in the Microsoft SQL server database installed locally on my laptop. But in order to run the application on every other laptop I have to migrate to localDB. Please suggest.!
Sorry if this is an obvious/dumb answer: The great value of web applications is that they can be accessed remotely by users who don't have to install anything to use them. Install your database and web application on a server and you can access it from anywhere.
We plan on pushing a windows application on computers external from our companies network (in various locations). I'm wondering what options I have for databases. I'd like to use SQL Server, but is there a way to avoid paying for licenses for each PC we load the windows application on?
Also, is there a way to have the data part of the executable when deploying the application, or would I need to install SQL Server on each machine?
Thanks!
As an alternative and a bit newer technology to Sql Server Compact Edition, you could use LocalDB.
Both are MS SQL products, but LocalDB doesn't have the disadvantages of CE, is still a file based DB and doesn't require the server installation, configuration and maintenance of SqlServer Express, only the runtime components.
Here you can find a nice comparison between Express, Compact and LocalDB
and here you can find the introduction of LocalDB by Microsoft.
The licensing of LocalDB is the same as for SqlExpress and you also need an installer to run for the runtime components of LocalDB (which is one downside when compared to CE).
Is there a way to avoid paying for licenses for each PC we load the windows application on?
Presumably you're just accessing a local database on these machines right? In that case you can use SQL Server Compact. It's free and pretty darn good.
Is there a way to have the data part of the executable when deploying the application?
If you're deploying your application via ClickOnce, then you can set SQL Server Compact as a prerequisite so the application will check for its presence and install it if needed.
Otherwise, you can push it out like any other prerequisite as part of the installer package (i.e. InstallShield or WiX).
Let's suppose I made an application in .net using sql server as database.
So if I want to deploy my application to some another PC i have to instal sql server
but I want that i should not install the sql server and my database should be automatically installed
i just want to make sure that is the concept of Local Database can fulfill my requirement
if so then how is it possible for me
thanks
You can use App_Data folder in the visual studio to store your .mdf files.Once you transfer your solution to a different system , the db file will be transferred automatically.
http://msdn.microsoft.com/en-us/library/ex526337.aspx
You should run your SQL server on a separate computer (server) to avoid having to install SQL server on all client computers. This way all PCs running your application can share a single instance of SQL Server.
If you want a single user DB per application instance I would recommend using SQL Compact edition instead
You can use SQL2012 Express Edition LocalDB. This uses a self contained file for your database, and can be installed as a prerequisite. When your application installs, you can install a blank database file, and connect to it.
SQL Server is not a small application that will be installed automatically and will require setup and configuration. You can however use it remotely. Or consider using an embedded database. But if you want to use a local database, you can use your mdf file of the database as a local database.