Пример #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);
        }
Пример #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);
        }
Пример #3
0
 public abstract bool ExecuteTQuery(TQuery tQuery);