public void GetExecuteResult(QueryInfo inf, string connectionString, string query) { System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { try { foreach (var queryResult in inf.ExecuteQuery(connectionString, query)) { var vm = new ResultDetailViewModel(); vm.View = queryResult.View; vm.SetAdditionalInfo(queryResult.Count, queryResult.ExecuteTime, queryResult.ExecuteSql, queryResult.ExecutionPlan); Result.Add(vm); } } catch (Exception e) { var vm = new ResultDetailViewModel(); var table = new DataTable("Exception"); table.Columns.Add("Message"); table.Rows.Add(e.Message); vm.View = table; Result.Add(vm); } })); }
public void GetExecuteResult(QueryInfo inf, string connectionString, string query) { System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { foreach (var queryResult in inf.ExecuteQuery(connectionString, query)) { var vm = new ResultDetailViewModel(); vm.View = queryResult.View; vm.SetAdditionalInfo(queryResult.Count, queryResult.ExecuteTime, queryResult.ExecuteSql); Result.Add(vm); } })); }