数据库
首页 > 数据库> > Oracle.ManagedDataAccess.Client 踩坑记录

Oracle.ManagedDataAccess.Client 踩坑记录

作者:互联网

错误一: Network Transport: TCP transport address connect failure

错误二:查询datatable 报 Index was outside the bounds of the array

EG:

command.CommandText = "SELECT EID,NOTICETYPE FROM NEWSADMIN.NP_BANK";

using (OracleDataAdapter da = new OracleDataAdapter(command))
{
DataSet ds = new DataSet();
try
{
da.Fill(ds, "ds");//该行报错Index was outside the bounds of the array
cmd.Parameters.Clear();
}
catch (OracleException ex)
{
LogHelper.LogDebug($"QueryData-OracleException:{ex.Message}",ex);
}
finally
{
cmd.Dispose();
//connection.Close();
}
return ds;
}

在执行到 da.Fill(ds, "ds") 时 Oracle.ManagedDataAccess.Client 内部会抛出异常:Index was outside the bounds of the array

解决方法

标签:ManagedDataAccess,TCP,outside,Client,Oracle,array,was,ds
来源: https://www.cnblogs.com/Alicia-meng/p/16499810.html