Oracle数据库连接从oracle db获取数据 [英] Oracle database connection to get the data from oracle db

查看:143
本文介绍了Oracle数据库连接从oracle db获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows服务来从oracle表获取数据

i已经提到了app.config文件中的连接字符串及其正确的

而连接时出现错误as

I have created one windows service to get the data from oracle table
i have mentioned the Connection string in app.config file and its correct
while connection im getting error as

TNS:could not resolve service name



i检查ora note pad文件中的服务名称是否正确bt仍然是我收到此错误

请建议解决方案



我尝试过:



在以下点获得错误




i checked for the ora note pad file for the service name it is correct bt still im getting this error
please suggest solution

What I have tried:

getting error at following point

public OracleConnection ConnectDB(OracleConnection dbConnection)
      {
          try
          {
              if (dbConnection.State != ConnectionState.Open)
              {
                  dbConnection.Open();
              }
              return dbConnection;
          }
          catch (DbException exp)
          {
              return null;
          }
      }

推荐答案

请按照本网站提供的步骤进行操作: ORA-12150到ORA-12236 [ ^ ]

进一步说明你会在这里找到: odbc - Oracle ORA-12154:TNS:无法解析服务名称错误? - 堆栈溢出 [ ^ ]
Please, follow the steps provided on this site: ORA-12150 to ORA-12236[^]
Further instruction you'll find here: odbc - Oracle ORA-12154: TNS: Could not resolve service name Error? - Stack Overflow[^]


这篇关于Oracle数据库连接从oracle db获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆