Ejemplo n.º 1
0
        private DBType GetDatabaseTypeFromString(string databaseConnectionString)
        {
            string FUNCTION_NAME = "GetDatabaseTypeFromString";

            LogHelper.Trace(CLASS_NAME, FUNCTION_NAME, "Function_Entered");

            //connection string will have dbtype at the first of the string with ';' as delimiter.
            string dbTypeString = databaseConnectionString.Substring(0, databaseConnectionString.IndexOf(DAOHelper.DB_Delimiter));
            DBType dbType       = DAOHelper.GetDbType(dbTypeString);

            LogHelper.Debug(CLASS_NAME, FUNCTION_NAME, string.Format("Database Type = {0}", dbType.ToString()));
            return(dbType);
        }
Ejemplo n.º 2
0
        private DBType GetDatabaseTypeFromString(string databaseConnectionString)
        {
            string FUNCTION_NAME = "GetDatabaseTypeFromString";

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                   EDebugLevelManaged.DebugInfo, "Function Entered.");

            //connection string will have dbtype at the first of the string with ';' as delimiter.
            string dbTypeString = databaseConnectionString.Substring(0, databaseConnectionString.IndexOf(DAOHelper.DB_Delimiter));
            DBType dbType       = DAOHelper.GetDbType(dbTypeString);

            LogHelperCli.GetInstance().Log_Generic(CLASS_NAME + "." + FUNCTION_NAME, LogHelperCli.GetInstance().GetLineNumber(),
                                                   EDebugLevelManaged.DebugInfo, string.Format("Database Type = {0}", dbType.ToString()));
            return(dbType);
        }
Ejemplo n.º 3
0
        private string getConnectionStringBasedType(string configFile, string dbLabel)
        {
            string connectionString;
            DBType dbType = DAOHelper.GetDbType(GetINIDataString(dbLabel, "DB_TYPE", "", 255, configFile));

            if (dbType == DBType.Oracle)
            {
                connectionString = GetINIDataString(dbLabel, "DB_TYPE", "", 255, configFile) + ";Data Source = " + GetINIDataString(dbLabel, "SERVICE_NAME", "", 255, configFile) + ";" +
                                   "User Id = " + GetINIDataString(dbLabel, "USER_ID", "", 255, configFile) + "; " +
                                   "Password = "******"USER_PASSWORD", "", 255, configFile) + "; ";
            }
            else
            {
                connectionString = GetINIDataString(dbLabel, "DB_TYPE", "", 255, configFile) + ";Database = " + GetINIDataString(dbLabel, "SERVICE_NAME", "", 255, configFile) + ";" +
                                   "User Id = " + GetINIDataString(dbLabel, "USER_ID", "", 255, configFile) + "; " +
                                   "Password = "******"USER_PASSWORD", "", 255, configFile) + ";Host = " + GetINIDataString(dbLabel, "HOST_NAME", "", 255, configFile) + ";Port=3306;";
            }
            return(connectionString);
        }