public static DBUtils GetInstance( DBServerTypes dbServerType_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return(dbUtils_PostgreSQL); #endif #if MySQL case DBServerTypes.MySQL: return(dbUtils_MySQL); #endif case DBServerTypes.SQLServer: return(dbUtils_SQLServer); } throw new Exception( string.Format( "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
public static DBConnection CreateInstance( DBServerTypes dbServerType_in, string connectionString_in, string logFile_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return new DBConnection_PostgreSQL( connectionString_in, logFile_in ); #endif case DBServerTypes.SQLServer: return new DBConnection_SQLServer( connectionString_in, logFile_in ); #if MySQL case DBServerTypes.MySQL: return new DBConnection_MySQL( connectionString_in, logFile_in ); #endif } throw new Exception( string.Format( "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
public DBConnectionParam( DBServerTypes dbServerType_in, string connectionstring_in ) { DBServerType = dbServerType_in; Connectionstring = connectionstring_in; }
public DBSimpleConnectionstring( DBServerTypes dbServerType_in, string connectionString_in ) { this.dbservertype_ = dbServerType_in; this.connectionstring_ = connectionString_in; }
// public static DBUtilities GetInstance( // string dbServerType_in // ) { // return GetInstance( // (DBServerTypes)Enum.Parse(typeof(DBServerTypes), dbServerType_in) // ); // } public static DBUtilities GetInstance( DBServerTypes dbServerType_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return(dbUtilities_PostgreSQL); #endif #if MySQL case DBServerTypes.MySQL: return(dbUtilities_MySQL); #endif case DBServerTypes.SQLServer: return(dbUtilities_SQLServer); } throw new Exception( string.Format( System.Globalization.CultureInfo.CurrentCulture, "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
public int Search( DBServerTypes dbServerType_in ) { for (int i = 0; i < this.cols_.Count; i++) { if ( ( #if NET_1_1 ((XS_tableFieldDBType)cols_[i]) #else this.cols_[i] #endif .DBServerType == dbServerType_in.ToString() ) ) { return(i); } } return(-1); }
public DBSimpleConnectionstring( DBServerTypes dbServerType_in, string connectionstring_in ) { dbservertype_ = dbServerType_in; connectionstring_ = connectionstring_in; }
public bool Contains(DBServerTypes dbServerTypes_in) { for (int d = 0; d < dbconnectionstrings_.Count; d++) { if (((DBConnectionstring)dbconnectionstrings_[d]).DBServerType == dbServerTypes_in) { return true; } } return false; }
public DBConnectionstring( DBServerTypes dbServerType_in, string connectionstring_in ) { dbservertype_ = dbServerType_in; connectionstring_ = connectionstring_in; connection_ = null; }
public cDBMetadata_Table_DB this[DBServerTypes dbServerType_in] { get { int _fi = Search(dbServerType_in); return((_fi >= 0) ? (cDBMetadata_Table_DB)db_[_fi] : null); } }
public cDBMetadata_DB this[DBServerTypes dbservertype_in] { get { int _ti = Search(dbservertype_in); return((_ti >= 0) ? (cDBMetadata_DB)dbs_[_ti] : null); } }
public DBConnectionstring( DBServerTypes dbServerType_in, string connectionstring_in ) : base ( dbServerType_in, connectionstring_in ) { connection_ = null; }
public DBConnectionstring( DBServerTypes dbServerType_in, string connectionString_in ) : base( dbServerType_in, connectionString_in ) { this.connection_ = null; }
public static DBConnection CreateInstance( DBServerTypes dbServerType_in, string connectionString_in ) { return CreateInstance( dbServerType_in, connectionString_in, null ); }
public int Search(DBServerTypes dbServerType_in) { for (int f = 0; f < db_.Count; f++) { if (((cDBMetadata_Table_DB)db_[f]).DBServerType == dbServerType_in) // already exists! { return(f); // returns it's position } } return(-1); }
public bool Contains(DBServerTypes dbServerTypes_in) { for (int d = 0; d < this.dbconnectionstrings_.Count; d++) { if (((DBConnectionstring)this.dbconnectionstrings_[d]).DBServerType == dbServerTypes_in) { return(true); } } return(false); }
public int Add( DBServerTypes dbServerType_in, string connectionstring_in ) { return dbconnectionstrings_.Add( new DBConnectionstring( dbServerType_in, connectionstring_in ) ); }
public int Search(DBServerTypes dbservertype_in) { for (int t = 0; t < dbs_.Count; t++) { if (((cDBMetadata_DB)dbs_[t]).DBServerType == dbservertype_in) // already exists! { return(t); // returns it's position } } return(-1); }
public static DBConnection CreateInstance( DBServerTypes dbServerType_in, string connectionString_in ) { return(CreateInstance( dbServerType_in, connectionString_in, null )); }
internal bool Contains_disableIfNot(DBServerTypes dbServerTypes_in) { bool contains_disableifnot_out = false; for (int d = 0; d < dbconnectionstrings_.Count; d++) { if (((DBConnectionstring)dbconnectionstrings_[d]).DBServerType == dbServerTypes_in) { ((DBConnectionstring)dbconnectionstrings_[d]).enabled_aux__ = true; contains_disableifnot_out = true; } else { ((DBConnectionstring)dbconnectionstrings_[d]).enabled_aux__ = false; } } return contains_disableifnot_out; }
public int Add( DBServerTypes dbServerType_in, string connectionString_in ) { return(this.dbconnectionstrings_.Add( new DBConnectionstring( dbServerType_in, connectionString_in ) )); }
public cDBMetadata_DB( iClaSSe aggregateloopback_ref_in, DBServerTypes dbServerType_in ) : base ( aggregateloopback_ref_in ) { //#region ClaSSe... DBServerType = dbServerType_in; //--- connections_ = new cDBMetadata_DB_Connections(this); //#endregion }
public cDBMetadata_DB( iClaSSe aggregateloopback_ref_in, DBServerTypes dbServerType_in ) : base( aggregateloopback_ref_in ) { //#region ClaSSe... DBServerType = dbServerType_in; //--- connections_ = new cDBMetadata_DB_Connections(this); //#endregion }
public cDBMetadata_Table_DB( iClaSSe aggregateloopback_ref_in, cDBMetadata_Table_DBs parent_ref_in, DBServerTypes dbServerType_in, string tableName_in ) : base ( aggregateloopback_ref_in ) { parent_ref_ = parent_ref_in; //#region ClaSSe... DBServerType = dbServerType_in; TableName = tableName_in; //#endregion }
public cDBMetadata_Table_DB( iClaSSe aggregateloopback_ref_in, cDBMetadata_Table_DBs parent_ref_in, DBServerTypes dbServerType_in, string tableName_in ) : base( aggregateloopback_ref_in ) { parent_ref_ = parent_ref_in; //#region ClaSSe... DBServerType = dbServerType_in; TableName = tableName_in; //#endregion }
public XS_tableFieldDBType this[ DBServerTypes dbServerType_in ] { get { int _index = this.Search( dbServerType_in ); return((_index == -1) ? null : #if NET_1_1 (XS_tableFieldDBType) #endif this.cols_[_index] ); } }
public XS_tableFieldDBType this[ DBServerTypes dbServerType_in ] { get { int _index = Search( dbServerType_in ); return (_index == -1) ? null : #if NET_1_1 (XS_tableFieldDBType) #endif cols_[_index] ; } }
internal bool Contains_disableIfNot(DBServerTypes dbServerTypes_in) { bool _output = false; for (int d = 0; d < this.dbconnectionstrings_.Count; d++) { if (((DBConnectionstring)this.dbconnectionstrings_[d]).DBServerType == dbServerTypes_in) { ((DBConnectionstring)this.dbconnectionstrings_[d]).enabled_aux__ = true; _output = true; } else { ((DBConnectionstring)this.dbconnectionstrings_[d]).enabled_aux__ = false; } } return(_output); }
public cDBMetadata_Table_Field_DB( iClaSSe aggregateloopback_ref_in, cDBMetadata_Table_Field_DBs parent_ref_in, DBServerTypes dbServerType_in ) : base ( aggregateloopback_ref_in ) { parent_ref_ = parent_ref_in; //#region ClaSSe... DBServerType = dbServerType_in; // Size = 0; DBType_inDB_name = string.Empty; DBDescription = string.Empty; DBDefaultValue = string.Empty; DBCollationName = string.Empty; //#endregion }
public cDBMetadata_Table_Field_DB( iClaSSe aggregateloopback_ref_in, cDBMetadata_Table_Field_DBs parent_ref_in, DBServerTypes dbServerType_in ) : base( aggregateloopback_ref_in ) { parent_ref_ = parent_ref_in; //#region ClaSSe... DBServerType = dbServerType_in; // Size = 0; DBType_inDB_name = string.Empty; DBDescription = string.Empty; DBDefaultValue = string.Empty; DBCollationName = string.Empty; //#endregion }
public int Add(DBServerTypes dbservertype_in, bool verifyExistenz_in) { int _ti; if (verifyExistenz_in) { _ti = Search(dbservertype_in); if (_ti != -1) { return(_ti); } } _ti = dbs_.Add( new cDBMetadata_DB( this, dbservertype_in ) ); return(_ti); // returns it's position }
public int Add(DBServerTypes dbServerType_in, bool verifyExistenz_in) { int _fi; if (verifyExistenz_in) { _fi = Search(dbServerType_in); if (_fi != -1) { return(_fi); } } _fi = db_.Add( new cDBMetadata_Table_Field_DB( this, this, dbServerType_in ) ); return(_fi); // returns it's position }
public static DBConnection CreateInstance( DBServerTypes dbServerType_in, string connectionString_in, string logFile_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return(new DBConnection_PostgreSQL( connectionString_in, logFile_in )); #endif case DBServerTypes.SQLServer: return(new DBConnection_SQLServer( connectionString_in, logFile_in )); #if MySQL case DBServerTypes.MySQL: return(new DBConnection_MySQL( connectionString_in, logFile_in )); #endif } throw new Exception( string.Format( System.Globalization.CultureInfo.CurrentCulture, "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
public int Search( DBServerTypes dbServerType_in ) { for (int i = 0; i < cols_.Count; i++) { if ( ( #if NET_1_1 ((XS_tableFieldDBType)cols_[i]) #else cols_[i] #endif .DBServerType == dbServerType_in.ToString() ) ) { return i; } } return -1; }
public static DBUtils GetInstance( DBServerTypes dbServerType_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return dbUtils_PostgreSQL; #endif #if MySQL case DBServerTypes.MySQL: return dbUtils_MySQL; #endif case DBServerTypes.SQLServer: return dbUtils_SQLServer; } throw new Exception( string.Format( "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
// public static DBUtilities GetInstance( // string dbServerType_in // ) { // return GetInstance( // (DBServerTypes)Enum.Parse(typeof(DBServerTypes), dbServerType_in) // ); // } public static DBUtilities GetInstance( DBServerTypes dbServerType_in ) { switch (dbServerType_in) { #if PostgreSQL case DBServerTypes.PostgreSQL: return dbUtilities_PostgreSQL; #endif #if MySQL case DBServerTypes.MySQL: return dbUtilities_MySQL; #endif case DBServerTypes.SQLServer: return dbUtilities_SQLServer; } throw new Exception( string.Format( System.Globalization.CultureInfo.CurrentCulture, "unsuported db type: {0}", dbServerType_in.ToString() ) ); }
public void LoadState_fromDB( dLoadState_fromDB notifyBack_in, DBServerTypes DBServerType_in, string Connectionstring_in, string subAppName_in, bool clear_in ) { const string OGEN_SP0__GETTABLEFIELDS = "OGen_sp0__getTableFields"; const string OGEN_SP0__GETTABLES = "OGen_sp0__getTables"; bool _exist_getTables = false; bool _exist_getTableFields = false; // #region for (...) Tables.Add(); DBConnection _connection = DBConnectionsupport.CreateInstance( DBServerType_in, Connectionstring_in ); _exist_getTables = _connection.SQLStoredProcedure_exists(OGEN_SP0__GETTABLES); _exist_getTableFields = _connection.SQLStoredProcedure_exists(OGEN_SP0__GETTABLEFIELDS); cDBTable[] _tables_aux = _connection.getTables( subAppName_in, _exist_getTables ? OGEN_SP0__GETTABLES : string.Empty ); cDBTableField[] _fields_aux = _connection.getTableFields( // _tables_aux[t].Name, // get's specific table fields string.Empty, // get's fields for all tables _exist_getTableFields //_exist_getTables ? OGEN_SP0__GETTABLEFIELDS : string.Empty ); if (clear_in) { tables_.Clear(); } for (int t = 0; t < _tables_aux.Length; t++) { // ToDos: here! virtual names //for (int ) { //} int T = tables_.Add(_tables_aux[t].Name, true); if (notifyBack_in != null) { notifyBack_in(string.Format("#{0}/{1} - {2}", t + 1, _tables_aux.Length, _tables_aux[t].Name), true); } tables_[T].isVirtualTable = _tables_aux[t].isVirtualTable; tables_[T].DBDescription = _tables_aux[t].DBDescription; // ToDos: here! virtual names //int TD = tables_[T].DBs.Add( // _connection.DBServerType, // _tables_aux[t].Name, // true //); if (clear_in) { tables_[T].Fields.Clear(); } for (int f = 0; f < _fields_aux.Length; f++) { if (_tables_aux[t].Name != _fields_aux[f].TableName) { continue; } int F = tables_[T].Fields.Add(_fields_aux[f].Name, true); tables_[T].Fields[F].Name = _fields_aux[f].Name; tables_[T].Fields[F].isIdentity = _fields_aux[f].isIdentity; tables_[T].Fields[F].isPK = _fields_aux[f].isPK; tables_[T].Fields[F].FK_TableName = _fields_aux[f].FK_TableName; tables_[T].Fields[F].FK_FieldName = _fields_aux[f].FK_FieldName; tables_[T].Fields[F].isNullable = _fields_aux[f].isNullable; tables_[T].Fields[F].Size = _fields_aux[f].Size; tables_[T].Fields[F].Numeric_Precision = _fields_aux[f].Numeric_Precision; tables_[T].Fields[F].Numeric_Scale = _fields_aux[f].Numeric_Scale; //tables_[T].Fields[F].DBDescription = _fields_aux[f].DBDescription; //tables_[T].Fields[F].DBDefaultValue = _fields_aux[f].DBDefaultValue; //tables_[T].Fields[F].DBCollationName = _fields_aux[f].DBCollationName; //--- int FD = tables_[T].Fields[F].DBs.Add( DBConnectionsupport.GetDBServerType(_connection), true ); tables_[T].Fields[F].DBs[FD].DBType_inDB_name = _fields_aux[f].DBType_inDB_name; tables_[T].Fields[F].DBs[FD].DBDescription = _fields_aux[f].DBDescription; tables_[T].Fields[F].DBs[FD].DBDefaultValue = _fields_aux[f].DBDefaultValue; tables_[T].Fields[F].DBs[FD].DBCollationName = _fields_aux[f].DBCollationName; #region //oldstuff... //tables_[T].Fields[F].DBType_inDB_name = _fields_aux[f].DBType_inDB_name; //tables_[T].Fields[F].Size = _fields_aux[f].Size; #endregion } } _fields_aux = null; _tables_aux = null; // #endregion }
public int Add(DBServerTypes dbServerType_in, string tableName_in, bool verifyExistenz_in) { int _fi; if (verifyExistenz_in) { _fi = Search(dbServerType_in); if (_fi != -1) return _fi; } _fi = db_.Add( new cDBMetadata_Table_DB( this, this, dbServerType_in, tableName_in ) ); return _fi; // returns it's position }
public cDBMetadata_DB this[DBServerTypes dbservertype_in] { get { int _ti = Search(dbservertype_in); return (_ti >= 0) ? (cDBMetadata_DB)dbs_[_ti] : null; } }
public int Add(DBServerTypes dbservertype_in, bool verifyExistenz_in) { int _ti; if (verifyExistenz_in) { _ti = Search(dbservertype_in); if (_ti != -1) return _ti; } _ti = dbs_.Add( new cDBMetadata_DB( this, dbservertype_in ) ); return _ti; // returns it's position }
public int Search(DBServerTypes dbservertype_in) { for (int t = 0; t < dbs_.Count; t++) if (((cDBMetadata_DB)dbs_[t]).DBServerType == dbservertype_in) // already exists! return t; // returns it's position return -1; }
public int Search(DBServerTypes dbServerType_in) { for (int f = 0; f < db_.Count; f++) if (((cDBMetadata_Table_DB)db_[f]).DBServerType == dbServerType_in) // already exists! return f; // returns it's position return -1; }
public void CopyFrom(cDBMetadata_DB dbMetadata_DB_in) { dbservertype_ = dbMetadata_DB_in.dbservertype_; connections_.CopyFrom(dbMetadata_DB_in.connections_); }
public void LoadState_fromDB( dLoadState_fromDB notifyBack_in, DBServerTypes DBServerType_in, string Connectionstring_in, string subAppName_in, bool clear_in ) { const string OGEN_SP0__GETTABLEFIELDS = "OGen_sp0__getTableFields"; const string OGEN_SP0__GETTABLES = "OGen_sp0__getTables"; bool _exist_getTables = false; bool _exist_getTableFields = false; // #region for (...) Tables.Add(); DBConnection _connection = DBConnectionsupport.CreateInstance( DBServerType_in, Connectionstring_in ); _exist_getTables = _connection.SQLStoredProcedure_exists(OGEN_SP0__GETTABLES); _exist_getTableFields = _connection.SQLStoredProcedure_exists(OGEN_SP0__GETTABLEFIELDS); cDBTable[] _tables_aux = _connection.getTables( subAppName_in, _exist_getTables ? OGEN_SP0__GETTABLES : string.Empty ); cDBTableField[] _fields_aux = _connection.getTableFields( // _tables_aux[t].Name, // get's specific table fields string.Empty, // get's fields for all tables _exist_getTableFields//_exist_getTables ? OGEN_SP0__GETTABLEFIELDS : string.Empty ); if (clear_in) tables_.Clear(); for (int t = 0; t < _tables_aux.Length; t++) { // ToDos: here! virtual names //for (int ) { //} int T = tables_.Add(_tables_aux[t].Name, true); if (notifyBack_in != null) notifyBack_in(string.Format("#{0}/{1} - {2}", t + 1, _tables_aux.Length, _tables_aux[t].Name), true); tables_[T].isVirtualTable = _tables_aux[t].isVirtualTable; tables_[T].DBDescription = _tables_aux[t].DBDescription; // ToDos: here! virtual names //int TD = tables_[T].DBs.Add( // _connection.DBServerType, // _tables_aux[t].Name, // true //); if (clear_in) tables_[T].Fields.Clear(); for (int f = 0; f < _fields_aux.Length; f++) { if (_tables_aux[t].Name != _fields_aux[f].TableName) { continue; } int F = tables_[T].Fields.Add(_fields_aux[f].Name, true); tables_[T].Fields[F].Name = _fields_aux[f].Name; tables_[T].Fields[F].isIdentity = _fields_aux[f].isIdentity; tables_[T].Fields[F].isPK = _fields_aux[f].isPK; tables_[T].Fields[F].FK_TableName = _fields_aux[f].FK_TableName; tables_[T].Fields[F].FK_FieldName = _fields_aux[f].FK_FieldName; tables_[T].Fields[F].isNullable = _fields_aux[f].isNullable; tables_[T].Fields[F].Size = _fields_aux[f].Size; tables_[T].Fields[F].Numeric_Precision = _fields_aux[f].Numeric_Precision; tables_[T].Fields[F].Numeric_Scale = _fields_aux[f].Numeric_Scale; //tables_[T].Fields[F].DBDescription = _fields_aux[f].DBDescription; //tables_[T].Fields[F].DBDefaultValue = _fields_aux[f].DBDefaultValue; //tables_[T].Fields[F].DBCollationName = _fields_aux[f].DBCollationName; //--- int FD = tables_[T].Fields[F].DBs.Add( DBConnectionsupport.GetDBServerType(_connection), true ); tables_[T].Fields[F].DBs[FD].DBType_inDB_name = _fields_aux[f].DBType_inDB_name; tables_[T].Fields[F].DBs[FD].DBDescription = _fields_aux[f].DBDescription; tables_[T].Fields[F].DBs[FD].DBDefaultValue = _fields_aux[f].DBDefaultValue; tables_[T].Fields[F].DBs[FD].DBCollationName = _fields_aux[f].DBCollationName; #region //oldstuff... //tables_[T].Fields[F].DBType_inDB_name = _fields_aux[f].DBType_inDB_name; //tables_[T].Fields[F].Size = _fields_aux[f].Size; #endregion } } _fields_aux = null; _tables_aux = null; // #endregion }
public cDBMetadata_Table_DB this[DBServerTypes dbServerType_in] { get { int _fi = Search(dbServerType_in); return (_fi >= 0) ? (cDBMetadata_Table_DB)db_[_fi] : null; } }
// #endregion #region Methods... #region public string DBType_generic_DBEmptyValue(DBServerTypes dbServerType_in); public string DBType_generic_DBEmptyValue(DBServerTypes dbServerType_in) { return DBUtilssupport.GetInstance(dbServerType_in).Convert.DBType2DBEmptyValue(DBs[0].DBType_generic.Value); }
// #endregion #region Methods... #region public string DBType_generic_DBEmptyValue(DBServerTypes dbServerType_in); public string DBType_generic_DBEmptyValue(DBServerTypes dbServerType_in) { return(DBUtilssupport.GetInstance(dbServerType_in).Convert.DBType2DBEmptyValue(DBs[0].DBType_generic.Value)); }