void MySQL_Connect_GetTable() { try { DataRowView myRow = (DataRowView)this.SolutionsDB_bindingSource.Current; SolutionsDBTablesDAL SolutionsDBTablesDAL = new SolutionsDBTablesDAL(); SolutionsDBTablesDAL.SolutionsDBID = this.CurrentDBID; SolutionsDBTablesDAL.isActive = true; SolutionsDBTablesDAL.UserId = Security.UserID; if (myRow != null && myRow["DBType"].ToString().ToLower() == "my sql") { mySql_DB_Tables = new DataTable(); this.mySqlDBFunctions.Server = myRow["ServerName"].ToString(); this.mySqlDBFunctions.DatabaseName = myRow["DBName"].ToString(); this.mySqlDBFunctions.DBUserName = myRow["UserName"].ToString(); this.mySqlDBFunctions.DBPassword = myRow["DPassword"].ToString(); if (this.mySqlDBFunctions.getConnection().State == ConnectionState.Open) { mySql_DB_Tables = this.mySqlDBFunctions.getTablesList(); if (mySql_DB_Tables != null && mySql_DB_Tables.Rows.Count > 0) { foreach (DataRow myTableRow in mySql_DB_Tables.Rows) { SolutionsDBTablesDAL.TableName = myTableRow["Tables"].ToString(); SolutionsDBTablesDAL.Insert(); } } } else { CommonClasses.Messages.GeneralError("Invalid server information.", " My DB SQL Connection"); } } else { CommonClasses.Messages.GeneralError("Selected DB is not My Sql DB.", " My DB SQL Connection"); } } catch (Exception ex) { CommonClasses.Messages.GeneralError(ex.Message, " My DB SQL Connection"); } }