Last post May 11, 2010 06:01 AM by Ravihimanshu
May 10, 2010 10:20 AM|db7|LINK
I am connecting to Oracle database from .net using OLEDB.
My Connection string :
string sConnectionString = "Provider=OraOLEDB.Oracle;" + "User ID =" + sUserName.ToUpper() + ";Password=" + sPassword.ToUpper() + ";Data Source=" + sDataSource;
I am using above ConnectionString to communicate with database. To make it work, I have to store password (don't want to do that) in session and use it every time I need to talk to db.
1) Is there any other connection string without username and password with oledb?
2) I use "Integrated Security" for MSSQL. How can I use the same with OLEDB - Oracle database?
Thanks in advance
May 11, 2010 05:57 AM|SSA|LINK
Check all here, trusted connection is one you need i.e. integrated authentication:
Oracle Provider for OLE DB
Provider=OraOLEDB.Oracle;Data Source=yourOracleDB;User Id=yourUsername;Password=yourPassword;
TNS-less connection string:
Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=yourHost)(PORT=yourPort)))(CONNECT_DATA=(SID=yourOracleSID)(SERVER=DEDICATED)));User Id=yourUsername;Password=yourPassword;
Complete listing for oracle provider connection string:
May 11, 2010 06:01 AM|Ravihimanshu|LINK
You can put the entire connection string in web.config file of your application as an appsettings (key and value pair). You can access the connection string wherever required using key/value pair in your application.