/// <summary>Return specified Rdb entity type's DATABASE table name
/// via a given PersistenceManager.</summary>
/// <param name="pRdbEntityType">RdbEntityType whose name may be different
/// than the corresponding SQL table name.</param>
/// <param name="pManager">The PersistenceManager which is our gateway to
/// the concrete database datasource.</param>
/// <remarks>
/// Includes table owner name, formatted per the applicable SQL provider, e.g.
/// orderInfo.GetSqlTableName returns "dbo"."MachineSummary".
/// </remarks>
public static string GetSqlTableName(Type pRdbEntityType, PersistenceManager pManager) {
RdbKey key = (RdbKey) pManager.DataSourceResolver.GetDataSourceKey(pRdbEntityType);
RdbQuerySqlFormatter formatter = new RdbQuerySqlFormatter(key.AdoHelper);
return formatter.QualifyTableName(pRdbEntityType);
}
In a smilar manner, to get the database name, get an RdbKey from the PersistenceManager. From the RdbKey, you can get the connection string. From the connectionstring, you can get the Database (or Host) name.