Example #1
0
        /// <summary>
        /// Check Database Table Existance
        /// </summary>
        /// <param name="pFileString">File String</param>
        /// <param name="pTableName">Table name</param>
        /// <returns>bool</returns>
        public static bool CheckDatabaseTableExistance(string pFileString, string pTableName, bool pIsConnectionString = false)
        {
            DataSets.Config.DataDriverDataTable dataDrivers = Configuration.GetNewInstance().DataDrivers;
            IDbDriverFactory dbFactory = null;

            foreach (DataSets.Config.DataDriverRow dataDriver in dataDrivers)
            {
                dbFactory = DbDriverFactoryCreator.GetDbDriverFactory(dataDriver.Type);

                if (dbFactory.CanClaimConnectionString(pFileString))
                {
                    break;
                }
            }

            IDbDriver dbDriver = DBReadExecute.GetDataDriver(pFileString, pIsConnectionString);

            return(dbDriver.CheckDatabaseTableExistance(pFileString, pTableName, pIsConnectionString));
        }