我在executereader行中出错。该错误显示内部.NET Framework数据提供程序错误30。
我要使用的代码是:
Try
Dim ss As String
Dim oradb As String = "db credentials"
Dim conn As New OracleConnection(oradb)
conn.Open()
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select m.branch_code from abc m where m.pfno='123'"
cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader()
dr.Read()
ss = dr.Item("branch_code")
conn.Dispose()
Catch ex As Exception
Throw ex
End Try
详细的错误报告如下所示:
System.InvalidOperationException was caught
HResult=-2146233079
Message=Internal .Net Framework Data Provider error 30.
Source=System.Data.OracleClient
StackTrace:
at System.Data.ProviderBase.DbBuffer.Validate(Int32 offset, Int32 count)
at System.Data.ProviderBase.DbBuffer.PtrToStringUni(Int32 offset)
at System.Data.OracleClient.OciHandle.PtrToString(NativeBuffer buf)
at System.Data.OracleClient.OracleInternalConnection.get_ServerVersion()
at System.Data.OracleClient.OracleInternalConnection.get_ServerVersionAtLeastOracle8()
at System.Data.OracleClient.OracleConnection.get_ServerVersionAtLeastOracle8()
at System.Data.OracleClient.OracleColumn.Describe(Int32& offset, OracleConnection connection, OciErrorHandle errorHandle)
at System.Data.OracleClient.OracleDataReader.FillColumnInfo()
at System.Data.OracleClient.OracleDataReader..ctor(OracleCommand command, OciStatementHandle statementHandle, String statementText, CommandBehavior commandBehavior)
at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Mylogin.GetMapIDEfftdate() in D:\Projects\BranchManager 22-11-2018\BranchManager\Mylogin.aspx.vb:line 247
InnerException:
我正在使用Oracle Database Client 11g R2。
答案 0 :(得分:0)
就我而言,unicode功能已在oracleDB中启用,但是我在连接字符串中再次提到了unicode="TRUE"
。因此,当我删除它时,.Net正常工作。
因此,您应该咨询数据库团队是否对数据库进行了任何新更新。