/// <summary> /// Queries the database for all hub data /// </summary> /// <returns></returns> private DataTable GetHubData() { var db = new AccessDatabase(this.querySetup.DatabasePath); var factory = new LocalityHubsQuerySQLFactory(this.querySetup); var builder = new StandardQueryBuilder(factory); var data = db.ExecuteQuery(builder.BuildSQL()); return(data); }
private DataTable GetData(string locality) { var db = new AccessDatabase(querySetup.DatabasePath); var factory = new VisitsByLocalityQuerySQLFactory(querySetup, locality); var builder = new StandardQueryBuilder(factory); Console.WriteLine("Retrieving data for {0}", locality); var data = db.ExecuteQuery(builder.BuildSQL()); return(data); }
/// <summary> /// Querys the database /// </summary> /// <param name="locality"></param> /// <returns></returns> private DataTable GetData(string locality) { var db = new AccessDatabase(this.querySetup.DatabasePath); var factory = new VisitsByLocalityQuerySQLFactory(this.querySetup, locality); var builder = new StandardQueryBuilder(factory); DataTable data = null; try { data = db.ExecuteQuery(builder.BuildSQL()); } catch (System.Data.OleDb.OleDbException ex) { throw new ArgumentException("Cannot open database. Please check that path is correct", ex); } return(data); }