public static ValuesDataSet getDataValues(int SiteID, int VariableID, DateTime StartDate, DateTime EndDate) { seriesCatalogDataSet scDS = new seriesCatalogDataSet(); SeriesCatalogTableAdapter seriesTableAdapter = new SeriesCatalogTableAdapter(); seriesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); seriesTableAdapter.FillBySiteIDVariableID(scDS.SeriesCatalog, SiteID, VariableID); DataSet oDS = new DataSet(); try { // oDS = getValuesWork(scDS.SeriesCatalog, StartDate, EndDate); Thread thread = new Thread(delegate() { oDS = getValuesWork(scDS.SeriesCatalog, StartDate, EndDate); }); thread.Start(); while (thread.IsAlive) { Thread.Sleep(150); } return(newTable(scDS.SeriesCatalog, ref oDS)); } catch (Exception e) { log.Fatal("Cannot retrieve information from database: " + e.Message); //+ valuesTableAdapter.Connection.DataSource } return(basicValuesDataSet()); }
public ValuesDataSet getDataValues(int SiteID, int VariableID, DateTime StartDate, DateTime EndDate) { seriesCatalogDataSet scDS = new seriesCatalogDataSet(); SeriesCatalogTableAdapter seriesTableAdapter = new SeriesCatalogTableAdapter(); seriesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); seriesTableAdapter.FillBySiteIDVariableID(scDS.SeriesCatalog, SiteID, VariableID); DataSet oDS = new DataSet(); try { oDS = getValuesWork(scDS.SeriesCatalog, StartDate, EndDate); } catch (Exception ex) { return(emptyValues(ex.Message)); } return(newTable(scDS.SeriesCatalog, ref oDS)); }