如何在asp.net中获取sqlserver名称 [英] How to get the sqlserver name in asp.net
本文介绍了如何在asp.net中获取sqlserver名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有人可以告诉我如何使用c#.net获得sqlserver名称而无需与sqlserver进行任何连接吗?
在此先感谢
Hi All,
Can anybody tell me how I can get the sqlserver name using c#.net without any connection to sqlserver?
Thanks in advance
推荐答案
尝试 ^ ]
希望它能对您有所帮助:)
Try This[^]
hope it helps :)
在安装过程中,应该知道Sql Server名称.
获得名称几乎没有意义,因为您的LAN中可能有很多Sql Server.
通常,数据库引擎与IIS安装在同一服务器上,因此如有疑问,请在连接字符串中使用(local)
.
The Sql Server name should be known as part of your installation process.
It makes little sense to get the name as there could be a lot of Sql Servers in your LAN.
Usually the database engine is installed on the same server as your IIS so if in doubt use(local)
in your connection string.
这篇关于如何在asp.net中获取sqlserver名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文