How do you Configure the Connection String for ODP.NET Connection String with FailOver?

老子叫甜甜 提交于 2019-12-23 21:58:43

问题


Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is what I use with System.Data.OracleClient.

SERVER=(DESCRIPTION_LIST=(LOAD_BALANCE=yes)(FAILOVER=ON)(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.80)(PORT=9960))(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.81)(PORT=9960)))(CONNECT_DATA=(SERVICE_NAME=tactota))));uid=XXXXXXX;pwd=XXXXXXXX"

Here is what I have gotten to work with ODB.NET, but does not implement the other features of the above connection string.

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.80)(PORT=9960)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tactota)));User Id=XXXXXXXX;Password=XXXXXXXX;

Here is what I got when I tried to roll them together, but needless to say it did not work.

Data Source=(LOAD_BALANCE=yes)(FAILOVER=ON)(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.80)(PORT=9960))(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.81)(PORT=9960)))(CONNECT_DATA=(SERVICE_NAME=tactota))); User Id=XXXXXX;Password=XXXXX;

Thanks!

Dave


回答1:


Finally got it to work! Here is what I came up with

Data Source=(DESCRIPTION=(LOAD_BALANCE=yes)(FAILOVER=ON)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.80)(PORT=9960))(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.140.81)(PORT=9960)))(CONNECT_DATA=(SERVICE_NAME=tactota))); User Id=XXXXXXX;Password=XXXXXXXX;



来源:https://stackoverflow.com/questions/2540529/how-do-you-configure-the-connection-string-for-odp-net-connection-string-with-fa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!