C#连接Oracle 11g 的连接字符串
为什么我必须要这样写才能连接上?stringstrcon="DataSource=(DESCRIPTION=" ...
为什么我必须要这样写才能连接上?string strcon="Data Source=(DESCRIPTION=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=Tanyixiu)(PORT=1521))" + "(CONNECT_DATA=(SERVICE_NAME=SmileDB)));" + "User Id=tanyixiu;Password=123abc;";这样写就不行呢?string strcon="Data Source=SMILEDB;User Id=tanyixiu;Password=123abc;";错误提示ORA-12154:TNS:无法解析指定的连接标识符.在tnsnames.ora中我配置了的啊:SMILEDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = Tanyixiu)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SmileDB) ) )
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询