Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI I am developing an application which is using Sqlserver 2005 with Winforms.My requirement is I have to build an application or add in for an windows application which is using sqlserver 2005.Now my Problem is the application have two part one brain an d other is work station now one can start brain in one machine and then can start workstation form another machine in network.I want to get the Sqlserver used by the Brain .How to do that Please reply soon running out of ideas

Thanks In Advance

Devopriyo
Posted
Comments
Charlemagne Gustilo 6-Mar-12 0:34am    
Hi! Are you trying to create applications that communicate with each other on the network, where in the workstation asks the brain it's sql server connection and the brain sends back the information? You can try System.Net.Sockets. As for sql server connection, both needs to have SQL Client in order for them to connect on the same server.
Member 8669805 7-Mar-12 8:01am    
Hi Can you give me some more detail.Please share your experience if you have done something like this before.
Thanks In Advance

Use System.Data.SqlClient.SqlConnectionStringBuilder

C#
string strCn=@"server=SQLInstance;database=DBName;user id=sa;password=password";
SqlConnectionStringBuilder cnBuilder = new SqlConnectionStringBuilder(strCn);
string db = cnBuilder.InitialCatalog;
string server = cnBuilder.DataSource;
 
Share this answer
 
v2

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