.net - 测试 OLE DB 连接字符串的快速方法

标签 .net connection-string oledb database-connection

出于调试目的,我想知道快速测试 OLE DB 连接字符串的方法。

我找到了this free software ,在我的机器上可以运行,测试成功。

有没有更快的方法来做到这一点,也许是通过 Windows 上的命令行?因为大多数时候,是客户而不是我来完成这个任务,所以我更喜欢“零安装”的方法,这样对他们的系统影响最小。

最佳答案

以下方法已证明对我有用。它 super 快速且实用,并且不需要 PowerShell:

  • Open up Notepad and create an empty text file, then click File -> click Save -> and save it with the File name: TestConnection.udl to your desktop.
  • Go to your desktop and double-click on the TestConnection.udl file you just created and the Data Link Properties box will popup.
  • Select the Provider tab and Find the provider that you want to connect with and click Next >>.
  • Now from the Connection tab, select or enter your source/ server name -> then enter information to log on to server -> and select the database on the server.
  • Click Test Connection and click OK to save the file. If errors occur during testing of your connection string, you will get a popup box with the error message.
<小时/>

演练(与上面相同,但带有图像)

打开记事本并创建一个空文本文件,然后单击文件 -> 单击保存 - 并将其以文件名:TestConnection.udl 保存到桌面:

enter image description here

转到桌面并双击刚刚创建的 TestConnection.udl 文件,将弹出“数据链接属性”框。

enter image description here

选择“提供商”选项卡,找到您想要连接的提供商,然后单击“下一步>>”。

enter image description here

现在,从“连接”选项卡中,选择或输入您的源/服务器名称 -> 然后输入登录服务器的信息 -> 并选择服务器上的数据库。

enter image description here

单击“测试连接”,然后单击“确定”保存文件。如果在测试连接字符串期间发生错误,您将看到一个包含错误消息的弹出框。

enter image description here

Source

关于.net - 测试 OLE DB 连接字符串的快速方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3910364/

相关文章:

asp.net - odbc 连接的连接字符串是什么?

sql-server - Visual Studio 2015 中的 Localdb 错误 52 (SQL Server)

c# - 从 MySQL 到 MS Access 的 1GB 数据

c# - 如何从 ListView 复制单个子项?

c# - 推荐一个可扩展的 SMTP 服务器

c# - 带有格式提供程序的 Expression.ToString()

.net - DeltaXML Diff 类似于 .Net 的库吗?

database - Informix "Invalid Argument"连接字符串异常

c# - NHibernate OleDB : Invalid program bind when using session. get<T>(id)

c# - C#asp.net中UPDATE语句中的语法错误