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); }
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); }
public abstract bool ExecuteTQuery(TQuery tQuery);