Reputation: 239
I have created a desktop application with SQL Server 2008 as backend. I want to use this database from my application that is installed on a number of machines.
What are the requirements for that application to connect to the centralized database.?
Upvotes: 0
Views: 1833
Reputation: 9790
To keep the connection string in its resources, ofcourse.
Resources are:
ConnectionString
" with the value like "Data Source = ..." whatever.Then you can run your sql scripts like:
SqlConnection conn =
new SqlConnection(Properties.Settings.Default.ConnectionString);
And go on.
Upvotes: 0
Reputation: 812
It is pretty simple, You want the architecture as Client-Server model were the server has the database .Hence you need to have MS SQLserver 2005 or higher versions and create database connect it to sqlserver. Grant permission for the clients to access the database.
From visual studio side: Add the above created .mdf(database file) as the new data source. Data-->Add new Data Source , and follow the steps in the wizard[p.s the type of connection has to be sql sever type ] while doing this a connection string will be created by VS. Use tht connection string to access from the client side.
This link would be useful : http://msdn.microsoft.com/en-us/library/sxds9ett(v=vs.80).aspx
Upvotes: 1