如果 sqlexpress 位于安装 SQLSERVER2008 的同一台计算机上,SmoApplication.EnumAvailableSqlServers() 不会列出默认实例
我正在使用 SMO 查找网络的可用 sqlserver。但是在我运行
应用程序的一台计算机中,它不会提供默认实例名称,但对于所有其他计算机,它
会显示指定的实例和默认实例。
观察我的场景。
的应用程序的本地机器
例如:机器名称:rkwrk3-vm-sr(我运行安装了sqlserver2008
)实际上我有sql2008作为默认实例,sqlexpress(2005)作为命名实例...
但它只显示一个实例rkwrk3-vm-sr\sqlexpress 并且它不支持 rkwrk3-vm-sr。
和其他一些机器 Hr-2k3-tm(安装了 sqlserver2005)
为此显示 Hr-2k3-tm 和 Hr-2k3-tm/sqlexpress
我如何解决此问题。非常感谢任何帮助。
提前致谢。
I am using SMO to find available sqlservers of a network.But in one machine where i running
application it doesnot give Default instance name but for all other machines it gives the
named and default instance wil be showing.
Observe my Scenario.
Ex: Machine Name :rkwrk3-vm-sr (local machine from where i am running app in which
sqlserver2008 installed)
in this actually i have sql2008 as default instance and sqlexpress(2005) as named instance...
But it shows only one instance rkwrk3-vm-sr\sqlexpress and it doesnot ahows rkwrk3-vm-sr.
and some other machines Hr-2k3-tm(where sqlserver2005 installed)
for this it is showing Hr-2k3-tm and Hr-2k3-tm/sqlexpress
How can i fix this .Any Help wil Greately Appreciated.
Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实例发现协议(1434 上的 UDP)由 SQL Browser 服务< /a>,默认情况下被禁用(为了纪念名为 Slammer 的东西...)。
确保该服务已在所有计算机上启用并启动。
The instance discovery protocol (the UDP on 1434) is served by the SQL Browser service, which by default is disabled (in memory of a thing named Slammer...).
Make sure the service is enabled and started on all machines.
使用替代方法获取服务器列表可能会有更好的运气。 也许 Microsoft 推荐使用
System.Data.Sql.SqlDataSourceEnumerator.Instance
枚举 SQL Server 实例
http://msdn.microsoft.com/en-us/library/a6t1z9x2。 aspx
或此方法:
使用 ODBC 在 C# 中枚举 SQL Server 实例
http://www.codeproject.com/KB/database/SubmitSQLInfoEnumerator.aspx
You might have better luck using an alternate method to get the server list. Perhaps this method recommended by Microsoft that uses the
System.Data.Sql.SqlDataSourceEnumerator.Instance
Enumerating Instances of SQL Server
http://msdn.microsoft.com/en-us/library/a6t1z9x2.aspx
Or this method:
Enumerate SQL Server Instances in C#, Using ODBC
http://www.codeproject.com/KB/database/SubmitSQLInfoEnumerator.aspx