Example #1
0
 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"];
 }
Example #2
0
 public static IEnumerable GetData() {
     using (AccessDataSource dataSource = new AccessDataSource("~/App_Data/gsp.mdb", "SELECT Year, Region, GSP FROM GSP"))
         return dataSource.Select(new DataSourceSelectArguments());
 }