Dot-Net
沒有 tnsnames.ora 文件的 Oracle 連接字元串
我正在使用帶有 System.Data.OracleClient 命名空間的 .NET 框架。我的電腦上安裝了 oracle 11 客戶端。我不想使用 tnsnames.ora 文件來儲存連接資訊。
如果我不想使用 tnsnames.ora 文件,有人可以告訴我連接字元串會是什麼樣子嗎?我會將連接字元串儲存在 Web 應用程序項目的 web.config 文件中。
http://www.connectionstrings.com/oracle
這是個很棒的資源
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))
(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));uid=myUsername;pwd=myPassword;
是你想要的,我相信…
從 10g 客戶端開始,您可以使用EZCONNECT功能,無需編輯 TNSNAMES.ORA 文件:
username/password@servername:port/instance. 例如 :Data Source=localhost:1521/XE;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True