在网络中获取SQL Server实例 [英] Getting Sql server Instance in Network

查看:67
本文介绍了在网络中获取SQL Server实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI 我正在开发一个使用Sqlserver 2005和Winforms的应用程序.我的要求是我必须构建一个应用程序或为使用sqlserver 2005的Windows应用程序添加内容.现在我的问题是该应用程序有两个部分,一个是大脑,另一个是工作站现在可以在一台计算机上启动大脑,然后可以在网络中的另一台计算机上启动工作站.我想让大脑使用Sqlserver.如何执行此操作,请尽快答复构想

在此先感谢

Devopriyo

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

推荐答案

使用System.Data.SqlClient.SqlConnectionStringBuilder

Use System.Data.SqlClient.SqlConnectionStringBuilder

string strCn=@"server=SQLInstance;database=DBName;user id=sa;password=password";
SqlConnectionStringBuilder cnBuilder = new SqlConnectionStringBuilder(strCn);
string db = cnBuilder.InitialCatalog;
string server = cnBuilder.DataSource;




请点击以下链接:

多线程客户端/服务器套接字类 [使用C#的简单客户端-服务器交互 [ C#中的TCP客户端服务器简介 [ ^ ]
用C#编写的TCP/IP服务器 [ ^ ]
客户端服务器通信 [
Hi,

Please follow these links:

Multi-threaded Client/Server Socket Class[^]
Simple Client-server Interactions using C#[^]
Introduction to TCP client server in C#[^]
A TCP/IP Server written in C#[^]
Client Server Communication[^]


这篇关于在网络中获取SQL Server实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆