在C#中获取网络上所有sql server实例的列表

编程入门 行业动态 更新时间:2024-10-28 04:25:58
本文介绍了在C#中获取网络上所有sql server实例的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

亲爱的专家, 为了获取我使用以下代码的sql server实例列表。

Dear Experts, For getting the list of sql servers instances on the i am using the below code.

SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; public DataTable GetInstances() { DataTable dtInstancesList = new DataTable(); dtInstancesList = instance.GetDataSources().Select("", "ServerName ASC").CopyToDataTable(); return dtInstancesList; }

我收到服务器列表,工作正常。 但这里的问题是, 在我的网络中,我们有两个域名,如A和B. 1.如果我在域A中运行此代码: 我正在获取SQL服务器实例的完整列表。 例如这里我得到的数量是100 2.如果我运行域B中的相同代码: 我没有获得SQl服务器实例的完整列表。 例如这里我的数量是10 为什么会这样,请告诉我解决方案。

I am getting the server list, its working fine. But the problem here is, In my network we are having two domains like A and B. 1. If i run this code in Domain A: I am getting full list of SQL server instances. for example here i am getting count is 100 2. If i run the same code in Domain B: I am not getting the full list of SQl server instances. for example here i am getting count is 10 Why this is happening, please let me know the solution.

推荐答案

阅读本文 [ ^ ] 请尝试阅读以上有关完全信任,网络流量以及导致您可能无法获得所有实例的其他因素的上述内容。 Read This[^] Try reading the above about full trust, network traffic, and other factors that lead to why you may not get all the instances.

更多推荐

在C#中获取网络上所有sql server实例的列表

本文发布于:2023-11-07 22:18:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567589.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实例   列表   网络   server   sql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!