需要安装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
即能得到数据库的名称

解决方案 »

  1.   

    两种方法:
    1.SQLDMO
    2.Window API
    不知道你要有那一中
      

  2.   

    说你的Email我给你发过去
    你要快呀
    我要走了
      

  3.   

    C#中使用SQL Server分布式管理对象(SQL-DMO)
    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