public static string ADOConnectionString( ObjectContext context )
{
return ( (EntityConnection)context.Connection ).StoreConnection.ConnectionString;
}
///
This works regardless of how the connection string names the database ("initial catalog", "database", etc.).
public static string DatabaseName( ObjectContext context )
{
return new SqlConnectionStringBuilder( ADOConnectionString( context ) ).InitialCatalog;
}
{
return ( (EntityConnection)context.Connection ).StoreConnection.ConnectionString;
}
///
public static string DatabaseName( ObjectContext context )
{
return new SqlConnectionStringBuilder( ADOConnectionString( context ) ).InitialCatalog;
}
No comments:
Post a Comment