Kevin,
I want to be able to connect to Oracle 9i database without having to
worry about "tnsnames.ora" file.My connection string looked something like
this
string connString = "DataSource =db.entry;UserID = usid;Password = pwd",
where "db.entry" is an entry from the tnsnames.ora fille which looks like
the following:
db.entry =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = my.community)
(PROTOCOL = TCP)
(Host = myserver)
(Port = 9875)
)
)
(CONNECT_DATA = (SID = mydatasource)
)
)
Now the problem is the "tnsnames.ora" exposes the server name, database name
name and its port , which is a security risk according to me. So my
questions is how to get rid of "tnsmanes.ora" file and create a connection
string.
Kevin, i cannot place the entry in the app.config file and use it during
runtime because when i tried to copy the entry above to the "DataSource"
attribute of the connection string but .NET complains that the connection
string is too long. So how should i construct my connection string i for the
situation i discussed without using the "tnsnames.ora" file?
Thanks
Bala
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:p6**************@TK2MSFTNGXA02.phx.gbl...
Hi Bala,
From the description, I think you need to connect to an Oracle 9i database
without using a tnsnames.ora file. Is there any misunderstanding here?
Using the tnsnames.ora file is the simplest way to access the Oracle
database. However, if you have concerns about disposing the data source,
you can try to hard code the connection string to your app.
If you're changing the connection string at runtime, you can also put the
connection string in the app.config file. Before put into the app.config
file, we can use some encryption mechanism to encrypt the whole connection
string. When getting the string, we decrypt it.
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."