GetConnectionId method
The value returned by this method is used in the "Connection Wizard" to display short information about the connection.
This value usually contains the name of the connection type and the name of the database. In MsSqlDataConnection
the implementation of the method looks like this:
public override string GetConnectionId()
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(ConnectionString);
string info = builder.InitialCatalog;
if (String.IsNullOrEmpty(info))
info = builder.AttachDBFilename;
return "MS SQL: " + info;
}
Note that SqlConnectionStringBuilder
is used to parse the connection string (ConnectionString
property).
You have to override this method.