无法连接oracle数据库gettng错误ORA-12154

时间:2017-02-22 12:36:00

标签: c# .net oracle

我正在使用oracle客户端连接数据库,并在打开连接时遇到错误。

tnsnameora中存在连接字符串。

以下是代码:

        string cs_OT = ConfigurationManager.ConnectionStrings["CON_OT_DB"].ConnectionString;
        string cs_MEDB = ConfigurationManager.ConnectionStrings["CON_ME_DB"].ConnectionString;

        OracleConnection Con_Pre_ot = new OracleConnection(cs_OT);
        OracleConnection Con_Pre_ME = new OracleConnection(cs_MEDB);


        Con_Pre_ME.Open();
        string Select_pk_id_row1 = "SELECT pk_id FROM (SELECT * FROM tss_ot_place_info ORDER BY pk_id desc) WHERE ROWNUM = 1";
        OracleCommand cmd_pk_id_r1 = new OracleCommand(Select_pk_id_row1, Con_Pre_ME);
        int pk_id_row1;
        pk_id_row1 = Convert.ToInt32(cmd_pk_id_r1.ExecuteScalar());
        //pk id for uk_tss_ot_place_info
        pk_id_row1_uk = pk_id_row1 + 1;

低于错误: ORA-12154:TNS:无法解析指定的连接标识符

还想通知您我能够与sql developer连接。

0 个答案:

没有答案