ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

Oracle.ManagedDataAccess.Client 踩坑记录

2022-07-20 21:03:26  阅读:426  来源: 互联网

标签:ManagedDataAccess TCP outside Client Oracle array was ds


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

  • 详细错误信息:Network Transport: TCP transport address connect failureOracle.ManagedDataAccess.Client.OracleException (0x80004005): Network Transport: TCP transport address connect failure
  • 解决方案
    • 首先一定确认你的服务跟你数据库服务的网络是通的 你可以通过telnet验证
    • 其次确认你的connectionString是否正确 ip 地址配置填充是否正确
      Eg: "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST ={0})(PORT = {1}))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = {2})));User Id={3};password={4};Connection Timeout ={5};Pooling=true;Max Pool Size=50;Min Pool Size=3;Connection Lifetime=180"
    • 然后确认防火墙关闭
    • 如果以上均正确 那就再配置项追加 "Validate connection=true" or "KeepAlive=true"

错误二:查询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

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有