public static ObservableCollection<ProjInfoData> GetProjInfoDatas(string dbName) { var list = new ObservableCollection<ProjInfoData>(); if (File.Exists(dbName)) { using (var deLinker = new DbOperator(dbName, DbCategory.Accdb)) { DataSet ds = deLinker.ExecuteDataSet("select * from ItemToData"); if (ds.Tables.Count == 0) return list; foreach (DataRow row in ds.Tables[0].Rows) { var data = new ProjInfoData { NumIndex = Convert.ToInt32(row["NumIndex"]), ProjInfo = row["ProjInfo"].ToString(), Unit = row["Unit"].ToString(), }; list.Add(data); } } } return list; }
private void WindowOnActionEvent(ProjInfoData data) { ItemsPool.Add(data); }