Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I am making an Windows based application with C# and using SQL Server Management Studio as Database.
When I'm creating a Database it is giving me 2 options for adding database as:

1. Local Database
2. Service-Based Database.

I am making this application in which I want to install the application in 5 Computers and on one computer as a Database under a Network

Which Database should I use? and while installing it how can I point the database path as right now I am using in my Home.

Please Help
Thanks
Posted
Updated 9-Jan-12 0:01am
v2

A service-based database is a database that is only accessed through a server. It uses an MDF data file, which is SQL Server format. To be able to connect to a SQL Server database the SQL Server service must be running, because it's that that processes your requests and access the data file.

A local database is one that is local to your application only. It uses an SDF data file, which is SQL Server CE (Compact Edition) format. There is no need to install a server to access an SDF database. You simply distribute the DLLs that constitute SSCE along with your app and access the data file directly.

source: (jmcilhinney) http://www.vbforums.com/showthread.php?t=530655


Based on your requirements, I think you'll want a service based application. This would be installed on your server, your clients then all connect to this database.
 
Share this answer
 
What is the Difference between Service Database and Local Database..

"A service-based database is a database that is only accessed through a server. It uses an MDF data file, which is SQL Server format. To be able to connect to a SQL Server database the SQL Server service must be running, because it's that that processes your requests and access the data file."

"A local database is one that is local to your application only. It uses an SDF data file, which is SQL Server CE (Compact Edition) format. There is no need to install a server to access an SDF database. You simply distribute the DLLs that constitute SSCE along with your app and access the data file directly."

Now you say that you need to install your application into 5 pc and your database is located in server and you need to access that from your local 5 pc.. m i right..?

so you need to use a service database wich contains MDF file, and use a connection string like this...

Data Source=192.168.3.225;Initial Catalog=Testing;Integrated Security=True

what you need to change in your existing connection string is data source
like in this demo string you need to provide you database server ip in data source
 
Share this answer
 
Comments
santosh.giri 9-Jan-12 16:22pm    
But, Dylan and Tejas, do I have to make the service after deploying setup or will be created automatically.

If yes then, Can I add it manually during installation?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900