ConnectionActiveState.DifferentCredentials Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating whether the credentials are different.
public:
property bool DifferentCredentials { bool get(); };
public bool DifferentCredentials { get; }
member this.DifferentCredentials : bool
Public ReadOnly Property DifferentCredentials As Boolean
Property Value
true
if the credentials are the same; otherwise, false
.
Examples
void OpenConnection(IServiceProvider serviceProvider,
ConnectionInfo newConnectionInfo) {
if (newConnectionInfo != null) {
IConnectionManager connectionManager =
(IConnectionManager)
serviceProvider.GetService(
typeof(IConnectionManager)
);
if (connectionManager == null)
return;
using (new WaitCursor()) {
ConnectionActiveState activeState =
connectionManager.GetConnectionActiveState(
newConnectionInfo);
if (activeState.DifferentCredentials) {
ShowMessage("ConnectionAlreadyExists",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
newConnectionInfo =
activeState.SimilarConnection;
}
MyActivateConnectionInfo(
connectionManager,
newConnectionInfo
);
}
}
}