Oracle.Connection 的替代品是什么?
我有一个 vb.net 程序失败,但没有给出错误。我刚刚发现我正在使用的代码已被弃用。但替代是什么? (这对于 MSDN 来说似乎是有用的,但我确信没有看到它。)
Private Sub SetConnectionToDB(ByRef oCMD As OracleCommand)
Dim connectionString As String
connectionString = My.Settings.ImportDataConnectionString
Dim OraDBConnection As OracleConnection
OraDBConnection = New OracleConnection(connectionString)
oCMD.Connection = OraDBConnection
oCMD.CommandType = CommandType.Text
End Sub
I have a vb.net program that is failing, but giving no errors. I've just discovered that the code I am using is deprecated. But what is the replacment? (That seems like something useful for MSDN to list, but I'm sure not seeing it.)
Private Sub SetConnectionToDB(ByRef oCMD As OracleCommand)
Dim connectionString As String
connectionString = My.Settings.ImportDataConnectionString
Dim OraDBConnection As OracleConnection
OraDBConnection = New OracleConnection(connectionString)
oCMD.Connection = OraDBConnection
oCMD.CommandType = CommandType.Text
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果有人需要详细说明,以下是我为另一位开发人员创建的步骤(我们使用 C# 进行开发,而不是 vb.net)。请注意,这是一个简单的迁移。
Oracle 指南:http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/dotnet/getstarted-c/getstarted_c_otn.htm。
我创建/遵循了以下步骤:
使用 Oracle.DataAccess.Client;
使用 Oracle.DataAccess.Types;
Conn = new OracleConnection(connectionString);
In case anyone needs this spelled out, here are the steps I created for another developer (we are developing using C#, not vb.net). Note that this was an easy migration.
The Oracle guide: http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/dotnet/getstarted-c/getstarted_c_otn.htm.
I created/followed these steps:
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
Conn = new OracleConnection(connectionString);
此 msdn 页面 指出
Oracle 和 ADO.NET 状态
This msdn page states that
Oracle and ADO.NET states
我知道很久以前就有人问过(并回答过)这个问题,但如果其他人刚刚发现这一点,我个人建议使用 适用于 .NET 的 Oracle 数据提供程序。
I know this was asked (and answered) a long time ago, but in case anyone else is just discovering this, I personally recommend using Oracle Data Provider for .NET.