Exemplo n.º 1
0
        public bool ExecuteTQuery(TQuery tQuery)
        {
            MySqlCommand command = Connection.CreateCommand();

            try
            {
                Connection.Open();
                command.CommandText = tQuery.toString();
                command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw new Exception("Unable to create table", ex.InnerException);
            }
            finally {
                Connection.Close();
                command.Dispose();
            }
            return(true);
        }
Exemplo n.º 2
0
        public DataBase ExecuteTQuery(TQuery tQuery)
        {
            //  tQuery.AddField
            if (this.Type == DataSourceType.MYSQL)
            {
                var serializedParent  = Newtonsoft.Json.JsonConvert.SerializeObject(tQuery);
                MYSQLTQueryBuilder ms = Newtonsoft.Json.JsonConvert.DeserializeObject <MYSQLTQueryBuilder>(serializedParent);
                //   MYSQLTQueryBuilder ms = (MYSQLTQueryBuilder) tQuery;

                if (ms.ValidateSchema())
                {
                    if (da.ExecuteTQuery(ms))
                    {
                        Result = true;
                    }
                    else
                    {
                        Result = false;
                    }
                }
            }

            return(this);
        }
Exemplo n.º 3
0
 public abstract bool ExecuteTQuery(TQuery tQuery);