Exemplo n.º 1
0
 public MysqlExplain(QueryComposer comp, MysqlHandler connection)
 {
     this.composer = comp;
     this.db       = connection;
     this.explainSelect();
     this.analyse();
 }
Exemplo n.º 2
0
        public static String getCompareString(QueryComposer qc, string fieldName)
        {
            string Statement = "";

            string compare = qc.getCompareValue(fieldName);

            if (null != compare)
            {
                switch (compare.ToUpper())
                {
                case "LIKE":
                    Statement = fieldName + " " + compare + " '%" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + "%' ";
                    break;

                case "IN":
                    Statement = fieldName + " " + compare + " (" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + ") ";
                    break;

                case "SUBSELECT":
                    Statement = fieldName + " IN (" + qc.getWhereValue(fieldName) + ") ";
                    break;

                default:
                    Statement = fieldName + " " + compare + " '" + qc.getWhereValue(fieldName).ToString().Replace("'", @"\'") + "' ";
                    break;
                }
            }
            return(Statement);
        }
Exemplo n.º 3
0
 public MysqlExplain(String sqlStr, MysqlHandler connection)
 {
     this.composer = null;
     this.sql      = sqlStr;
     this.db       = connection;
     this.explainSelect();
     this.analyse();
 }
Exemplo n.º 4
0
        public TableToForm(string tableName, MysqlHandler DataBase)
        {
            this.db        = DataBase;
            this.TableName = tableName;
            if (!DataBase.isConnected())
            {
                throw new Exception("Database not connected. TableToForm needs an connected MysqlHandler");
            }

            maskQuery = new QueryComposer(this.TableName);
        }