VB.Net MsSQL连接测试 [英] VB.Net MsSQL connection test
本文介绍了VB.Net MsSQL连接测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我会制作一些代码来测试Linux和Windows网络和数据库服务器的功能。
i我有.Net方面的数据库测试有点问题(因为我对.Net不太熟悉)
有人可能会给我一个连接到MsSQL DB的VB.Net代码然后返回成功或失败的消息?
这就是我需要完成我的小快速服务器测试器= P
所以非常感谢你你的帮助!
解决方案
使用try / catch块并在catch中编写err.description。这是一个提供您的网站 - 连接字符串:
使用try / catch块并在catch中编写err.description。这是一个提供您的网站 - 连接字符串:
你能给我一个捕获语法吗?
试试
''一些代码
抓住
label1.text = err.description
最后
''可选代码
结束尝试
hi everyone,
im making a little code to test the funktionality of Linux and Windows web and DB servers.
i am having a little problem with the DB test on the .Net side (as im not so experienced with .Net)
can someone maybe give me a VB.Net code which connects to a MsSQL DB and then returns a success or failed message?
that would be all i need to finish my little quicky server tester =P
therefore thank you very much for your help!
解决方案
Use a try/catch block and write err.description in the catch. Here is a site that will provide your - connection string:
Use a try/catch block and write err.description in the catch. Here is a site that will provide your - connection string:can you provide me a syntax for the catch?
Try
''some code
Catch
label1.text = err.description
Finally
''optional code
End Try
这篇关于VB.Net MsSQL连接测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文