Ya, jika Anda menggunakan string koneksi yang berisi data tnsname.ora
.
Katakanlah entri tnsname Anda terlihat seperti ini:
YourTnsName =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = YourHost)(PORT = 1521))
)
(CONNECT_DATA =
(SID = YourSid)
)
)
daripada menggunakan YourTnsName
di string koneksi, Anda dapat menulisnya seperti ini:
var constr = new OracleConnectionStringBuilder()
{
DataSource = @"(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = YourHost)(PORT = 1521)))(CONNECT_DATA =(SID = YourSid)))",
UserID = "userid",
Password = "password",
}.ConnectionString;
using (var con = new OracleConnection(constr))
{
...
}
maka tidak ada entri di tnsname.ora
dibutuhkan.