Entry: ODP.NET OpenWithNewPassword 3/16/2005



Oracle allows users' password to expire. ODP.NET lets applications handle the password expiration by providing a new method, OpenWithNewPassword, that opens the connection with a new password.
The following code snippet uses the OracleConnection OpenWithNewPassword method to connect with a new password of panther:
// C#
...
OracleConnection con = new OracleConnection();
con.ConnectionString = "User Id=scott;Password=tiger;Data Source=oracle;";
// Here the con.Open() fails if the password has expired.
// An application catches this and attempts to reconnect with a new password
// of "panther". The initial connection string must remain intact.

try {
con.Open();
}
catch {
con.OpenWithNewPassword("panther");
}

   2 comments

mulberry outlet shops
April 26, 2012   05:52 PM PDT
 
well this blog is great i love reading your articles.,292922,http://dotnetraj.blogdrive.com/archive/88.html
Name
October 8, 2012   06:40 PM PDT
 
your artical looks like food taste so delicious, much information is very useful to me. thanks,133400,http://dotnetraj.blogdrive.com/archive/88.html

Leave a Comment:

Name


Homepage (optional)


Comments