private static int GetCategoryId() { AccessDataSource ds = new AccessDataSource(); ds.SelectCommand = "SELECT TOP 1 CategoryID FROM Categories ORDER BY CategoryID DESC"; ds.ID = "test1"; ds.DataFile = Path + "\\App_Data\\Nwind.mdb"; return (int) ((DataView) ds.Select(DataSourceSelectArguments.Empty))[0]["CategoryID"]; }
public static IEnumerable GetData() { using (AccessDataSource dataSource = new AccessDataSource("~/App_Data/gsp.mdb", "SELECT Year, Region, GSP FROM GSP")) return dataSource.Select(new DataSourceSelectArguments()); }