I have created windows application using windows c#.net and ms sql server 2008. And i am going to build setup file including database. Is that possible to build a setup including DB with out installing MS SQL Server 2008 in my client system?. If possible, this helps no need to install SQL server in my client system or else give a possible feedback. Thanks in advance.
You won't be able to load and use the database without a server running somewhere. Now, you could install that database on a remote server that is provided during installation - but a server has to be running somewhere.
Even loading it via file requires SQL Express to be running.
You can convert database to file (by detaching database) and then add that file to your project.
Related
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.
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.
i have a winform application in c#on visual studio, connected to a database in sql server 2008 and i have done a deployment to it so to use it i must install the sql server management studio and restore the database backup, so Can i when doing the deployment and setup project include or take the database backup to not need to install the SQL server management studio on the PC use this application and from the application i will take a backup from the updated database which has new records
So how do i make a deployment and setup project and embedded in it the database used so i'll not be needed to install the sql server in the PC which act as a server and the clients PCs as i want to use the application in a network?
If your database is trivial, should be accessible from a single computer and is used to store local data look to the.
http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx. For sure you will need to read additional articles about how to use it and deploy it, but this should be a starting point. NOTE: you will not have stored procedures and advanced SQL Server features, but you will use the same code as you do now.
Note that if you want to restored a database from backup to an arbitrary SQL Server instance, you may encounter problems if the instance to which the backup is being restored is configured with options different than the original SQL Server instance (e.g., collation sequence, case-sensitivity, ANSI settings, etc.) If the default collation sequence is different, you may have problems with indices, for instance.
You can use sqlcmd for that, it installs with MSSQL server on client machine look here for details.
After you created bat file, you can run it from code use Process.Start
It's not the SQL Management Studio that is needed to be installed to make the program work, it's SQLServer that must be installed.
For small applications it maybe to much of work to administrate a SQLServer, in that case its better to use other database types... I used to use XML files, lately I use Sqlite, its very good no installation required. and it integrates great into Visual Studio.
Edit: If you only need to restore a .bak you could use that http://sqlbackupandftp.com/restore/ its very nice and easy, and its a very small file.
I have one problem with service base database, I have used it in one of my application but I dont know if user who'll use it need to have something installed to be able to run application (like you need to have installed NET framework for c# applications)
Note: This is windows application
It depends on what database engine you're using. SQL Server/SQL Express/Oracle/MySQL require you install the application on the machine before it'll work. databases engines like SQLite and Firebird are just Dll's, so you can include then in your project.
If the file is an MDF that's a SQL Server file - you need to install SQL server, or SQL express.
You can include it with your app and do it silently:
http://social.msdn.microsoft.com/forums/en-US/sqlsetupandupgrade/thread/7180e4dc-5c1e-4501-83d7-6882abb1f04e/
You will need to install the relevant database engine with the correct service name, and create the database and relevant objects on installation.
I have a brand new database on an ISP which I intend to use to build an ASP.NET data-driven website. However, I would like to build the whole thing locally and transplant the database to the ISP.
I have TCP/IP access (i.e. I can connect to the remote database directly thru SQL Server Management Studio Express), but I do not have Terminal Services access, as this is a database shared with other users of the ISP.
Is there a simple way to "replicate" my local development database to the remote server?
One way is to use something like the Database Publishing Wizard to create an SQL script, and then run that script in SQL Server Management studio in the remote database.
Apparently this is integrated in Visual Studio 2008 (didn't know that before).
I just had a similar problem. I downloaded and used the SQL Server Pulishing Wizard.
Can be found here. You end up with a single script file that you apply to your database and it creates everything including the data.
You could just backup the database on your local server and restore it onto the target server. This'd be easier if the collation of the two servers were the same, but even that's not a show-stopper. Scripting the database is fine while it's empty, but it gets trickier if you want to move it back and forth once it has data in it.
How about putting your database in the App_Data folder? You can create it straight from Visual Studio. It should then auto-mount. Then you should be able to just copy it over with the rest of the files.
Assuming you have FTP access, upload a "COPY ONLY" backup of the database to the server and then use Management Studio express to restore the backup and browse to the file and restore it on the server. Should work ok if the SQL version is compatable.