50分紧急求助:.NET 连接 Oracle 出现 "ORA-06413: 连接未打开。"
connection.ConnectionString="Provider=msdaora;UserID=livell;Password=abc--123;DataSou...
connection.ConnectionString = "Provider=msdaora;User ID=livell;Password=abc--123;Data Source='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=develop-01)(PORT=1521)))(CONNECT_DATA=(SID=hy)(SERVER=DEDICATED)))';Persist Security Info=True";
Provider换用OraOLEDB.Oracle也一样是连接未打开,pl/sql可以正常连接,程序目录中也没有带括号。
环境:
windows server 2008 x64
Oracle 10g
VS 2010 展开
Provider换用OraOLEDB.Oracle也一样是连接未打开,pl/sql可以正常连接,程序目录中也没有带括号。
环境:
windows server 2008 x64
Oracle 10g
VS 2010 展开
1个回答
展开全部
试试:
1. 把这段存储到Oracle‘的客户端tnsname.ora配置文件中,并命名:
hy=
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=develop-01)(PORT=1521)))(CONNECT_DATA=(SID=hy)(SERVER=DEDICATED)))
2. 在程序中用 hy进行连接
connection.ConnectionString = "Provider=msdaora;User ID=livell;Password=abc--123;Data Source=hy;Persist Security Info=True";
3. 如不还不行,去掉 Persist Security Info=True 试试
1. 把这段存储到Oracle‘的客户端tnsname.ora配置文件中,并命名:
hy=
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=develop-01)(PORT=1521)))(CONNECT_DATA=(SID=hy)(SERVER=DEDICATED)))
2. 在程序中用 hy进行连接
connection.ConnectionString = "Provider=msdaora;User ID=livell;Password=abc--123;Data Source=hy;Persist Security Info=True";
3. 如不还不行,去掉 Persist Security Info=True 试试
追问
不行啊
追答
去掉 (SERVER=DEDICATED) 试试
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=develop-01)(PORT=1521)))(CONNECT_DATA=(SID=hy)))
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询