Creating new data model using Data Model Editor

1. Run Data Model Editor (DME)

Of course, it's an obvious step but it may cause some difficulties as well. If you already downloaded and installed EasyQuery (both trial or full version) then DME is already installed on your computer. For Windows 7 and earlier versions you can find it through Start menu: Start | All Programs | Korzh EasyQuery | Data Model Editor. For Windows 8 just open Start screen and start to type “Data Model Editor”.

2. Create new model and establish a database connection

  • Use “Model | New..” menu item
  • Type the name of your model (e.g. “MyModel”)
  • Choose the type of database connection (e.g. “MS SQL Server (native)”)
  • Enter the connection string. You can use “Build connection string” to construct the connection string visually.
  • Test your database connection using “Test connection” button.
  • Press OK to finish model creating

Data Model Editor - new model

3. Fill the list of tables

After pressing OK and closing the previous dialog you will be asked to add database tables into your model. Click “Yes” to agree and the Select Tables dialog will appear.

Data Model Editor - fill tables list

Select the tables you want to add into your model (select all of them if you don't have any limitations) and press OK to add them.

DME will offer you to add the links automatically using information about foreign keys or (if foreign keys are not defined in you DB) a special algorithm which searches for field pairs in all added tables (e.g. table1.customerID → table2.customerID). Select “Yes” to start that process. When it is finished you can check added links for each table in “Links” list box.

5. Save your data model into XML

That's mostly all. The initial setup has been finished. Use “Model | Save..” menu item to save your model into an XML file.

Data Model Editor - save model

You will load this XML file in your application LoadFromFile(“path to file”) method of DbModel class.