【问题标题】:May I use SqlHelper Class in VB.NET if Oracle is the database?如果 Oracle 是数据库,我可以在 VB.NET 中使用 SqlHelper 类吗?
【发布时间】:2014-02-12 18:58:23
【问题描述】:

我在我的应用程序中使用 SqlHelper。如果使用 SQL Server 作为数据库,它可以正常工作。但它在 Oracle 中不起作用。

它显示:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

我该如何解决?

【问题讨论】:

    标签: c# vb.net oracle sqlhelper


    【解决方案1】:

    您需要使用Oracle Data Provider for .NET,因为 SqlHelper 仅适用于 SQL Server。据我所知,微软一直在推荐使用 Oracle 的 .NET 数据提供程序而不是内置的 System.Data.OracleClient。根据我们在这里的测试,Oracle 驱动程序胜过微软的 Oracle 驱动程序。

    【讨论】:

      【解决方案2】:

      您应该使用 System.Data.OracleClient 库来连接 .NET 中的 Oracle 数据库。 SQL 帮助程序专门设计用于SQL Server

      【讨论】:

        猜你喜欢
        • 2018-03-15
        • 2022-12-18
        • 1970-01-01
        • 1970-01-01
        • 2011-02-28
        • 2020-09-24
        • 2023-04-02
        • 1970-01-01
        • 2013-10-21
        相关资源
        最近更新 更多