需要安装SQLServerSP3的补丁在你的工程中引用Interop.SQLDMO.DLL文件通过下面的方法得到:SQLDMO.ApplicationClass sqlApp = new SQLDMO.ApplicationClass();
SQLDMO.NameList nameList =null;
try
{
nameList =sqlApp.ListAvailableSQLServers();
}
catch(Exception ex)
{
Response.Write("<error>"+ex.Message+"</error>");
return;
}
string ret=null;
for(int i=1;i<nameList.Count + 1;i++)
{
ret =nameList.Item(i); //这里即是
}
通过
select name from sysdatabases
即能得到数据库的名称
SQLDMO.NameList nameList =null;
try
{
nameList =sqlApp.ListAvailableSQLServers();
}
catch(Exception ex)
{
Response.Write("<error>"+ex.Message+"</error>");
return;
}
string ret=null;
for(int i=1;i<nameList.Count + 1;i++)
{
ret =nameList.Item(i); //这里即是
}
通过
select name from sysdatabases
即能得到数据库的名称
解决方案 »
- 关于泛型的一点小疑问!
- 谁能给我一个socket长连接的源码
- C#中serialport控件的pinchanged使用
- 查询数据抱错 FormatException
- 求教高手 高手 高高手 非常的急 在线等待 Server Error in '/' Application. Runtime Error
- 如何在窗体之间传值?在线等.......
- 水晶报表的问题,导出报表时(Execl)时导出的页面一下就闪过去了,请问原因??(抱歉没有分了)
- Excel的Workbooks.Open报错,请各位帮忙看看
- WPF WPFMediaKit 摄像头截图
- (迷惑)在C#里怎样做电子表格?
- 在C#中实现"全局数组"
- 关于统计汇总的问题,解决者重谢!
1.SQLDMO
2.Window API
不知道你要有那一中
你要快呀
我要走了
http://dotnet.aspx.cc/ShowDetail.aspx?id=BCEAADFB-CFF3-4804-B3B3-6C7D6488982B这样取得本局域网内所有可用sql服务器名?
http://community.csdn.net/Expert/topic/3193/3193597.xml?temp=.5120355我用程序可以找到局域网内的所有SQL服务器名,我怎么才能得到他们的IP地址呢?
http://community.csdn.net/Expert/topic/3667/3667420.xml?temp=.672619如何获取系统中已经有的sql服务器名
http://community.csdn.net/Expert/topic/3457/3457054.xml?temp=.295788