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?
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.
Member
1 Points
3 Posts
oracle - connection string without username and password
May 10, 2010 10:20 AM|db7|LINK
I am connecting to Oracle database from .net using OLEDB.
My Connection string :
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?
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">string sConnectionString = "Provider=OraOLEDB.Oracle;"</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> // + "User ID =" + sUserName.ToUpper()</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> // + ";Password=" + sPassword.ToUpper()</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> // + ";Data Source=" + sDataSource;</div>Thanks in advance
Oracle Connection String Oledb
Contributor
6865 Points
1752 Posts
Re: oracle - connection string without username and password
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
Standard Security:
Provider=OraOLEDB.Oracle;Data Source=yourOracleDB;User Id=yourUsername;Password=yourPassword;
Trusted connection:
Provider=OraOLEDB.Oracle;Data Source=yourOracleDB;OSAuthent=1;
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:
http://connectionstringexamples.com/staticpages/index.php?page=20080710090445267
Member
377 Points
140 Posts
Re: oracle - connection string without username and password
May 11, 2010 06:01 AM|Ravihimanshu|LINK
Hello,
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.