问题
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