
Untitled
By: a guest on
Jul 20th, 2012 | syntax:
None | size: 0.66 KB | hits: 9 | expires: Never
How to compare open connection string with connection string from config file
if(con.ConnectionString == ConfigurationManager.ConnectionStrings["Con1"].ConnectionString);
if (DateTime.Now.Subtract(lastDBcheck).TotalSeconds > 10 && con.ConnectionString==ConfigurationManager.ConnectionStrings["Con1"].ConnectionString)
var con1 = ConfigurationManager.ConnectionStrings["Con1"];
if (con != null && con1 != null && con.ConnectionString == con1.ConnectionString) {
// Connection strings are the same.
}
The .NET Framework Data Provider for SQL Server does not persist or return
the password in a connection string unless you set Persist Security Info to true.