/
Form1.cs
25 lines (22 loc) · 863 Bytes
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
using System.Windows.Forms;
namespace MapArbitraryDatabaseExample {
public partial class Form1 :Form {
public Form1() {
InitializeComponent();
BindCategories();
BindProducts();
}
void BindCategories() {
gridControl1.DataSource = new XPCollection(session1, session1.GetClassInfo(string.Empty, "Category"));
}
void BindProducts() {
SimpleDataLayer dataLayer = (SimpleDataLayer)session1.DataLayer;
ConnectionProviderSql provider = (ConnectionProviderSql)dataLayer.ConnectionProvider;
DBTable[] tables = provider.GetStorageTables("Product");
gridControl2.DataSource = new XPCollection(session1, Program.AddClass(session1.Dictionary, tables[0]));
}
}
}