Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,
I have one window application installed on server computer. I want access database from server from other computer by using same application. Plz help me.
Posted

I would suggest to start here: ADO.NET[^]
ADO.NET (core data access)[^]

To share data between computers in LAN/WAN you need to enable TCP/IP connection[^]. Sometimes it is necessary to configure Windows Firewall to allow access to MS SQL server[^].

Next, you should define proper connection-string to MS SQL server[^].
 
Share this answer
 
v2
Comments
Kishor Mali 23-Dec-13 6:01am    
everything is done, but i am not able to do that. can you explain me in detail please with small demo.
Maciej Los 23-Dec-13 6:47am    
Follow the links. There you'll find examples.
You haven't really provided enough information for us to be able to help - we don't know the first thing about the application or its database to be able to say anything we can be sure will be meaningful.

Most importantly it would help if you told use the technology of the database. Is it MS Access? MS SqlServer? Oracle? MySql? MongoDB? Something else entirely?

Is it a server-based database or is it file-based database?

You say you want to access the database from some other computer by using the same application. Do you mean 'by using the application on the server as a conduit' (probably not)? Do you mean 'by installing the application on the other computer, but referencing the data stored on the server'? I would start by reading the installation guide for the application, paying special attention to the section (if any) that relates to having the application and its data on distinct computers.
 
Share this answer
 
Comments
Kishor Mali 23-Dec-13 6:17am    
SQL server-based database. by installing the application on the other computer, but referencing the data stored on the server.
Let me understand this.
Your db is in dbserver1 and your application app1.exe is in appServer1. Now u want to access the db from appServer2 using ur app1.exe. In this case, as this is windows application, move ur app1.exe to appServer2 and run it from there. Also check if u dont have any connectivity problem to your dbServer1 from appServer2.
 
Share this answer
 
Comments
Kishor Mali 23-Dec-13 6:27am    
I am using this connection string on server computer

Data Source=SOFTZEAL-2-PC\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.mdf;Integrated Security=True;User Instance=True; User ID=kishor;PWD=kishor123

It works on server only but not on remote computer...

Error Showing...

Invalid value for key 'attachdbfilename'.
You can't use AttachDbFilename to connect to remote database.
Check this link http://support.microsoft.com/kb/914277[^]
 
Share this answer
 
Comments
Kishor Mali 23-Dec-13 6:43am    
Please, Tell me which connectionstring should I use....I am using SQL server 2008
First check if remote connection is enabled for the db server.
To enable follow this link.
http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

Once this is done then modify your connection string like this:
Data Source=SOFTZEAL-2-PC\SQLEXPRESS;Initial Catalog=Database;Integrated Security=True;User Instance=True; User ID=kishor;PWD=kishor123
 
Share this answer
 

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