Dataset, xsd file, datagrid, expressions and parent/child relations?!

G

Guest

Is it possible to create a dataset xsd file with multiple tables, relations and expressions, where the following is true to work, starting with an empty dataset. I would really like to see a xsd that works. And I do not want to connect to some database; saving the dataset is well sufficient
1. Expression using column names within same table only.
Example OrderTotalPrice = OrderUnitPrice * OrderQuantity
2. Expression using parent relation to get simple column data.
Example OrderCustName = Parent(CustomerOrder).CustomerNam
3. Complex expression using child relation to get simple column data.
Example CustomerTotalOrderPrice = Sum( Child(CustomerOrder).OrderUnitPrice * Child(CustomerOrder).OrderQuantity
4. Binding various tables to various datagrids simultaneously
Example three datagrids; one to show Customers table only, one for Orders table only, and finally one for Customers table where expansion to child elements is allowed. Editing generally beeing allowed
5. Using DataGridComboBoxColumnStyle on some of these datagrids to enable selection of required parent relation ID, displaying required parent relation name
Example datagridOrders having a DataGridComboBoxColumnStyle for the OrdersCustomerID field displaying Parent(CustomerOrder).CustomerName, value from (CustomerOrder).CustomerI

I beleive from the documetation that it for 1-5 should be possible to generate a dataset using the xsd dataset helper in visual studio only. No other programming with the dataset necessary. For the datagrids part I beleive it is only necessary to set the necessary databindings in 4, simply using the designer and no other programming needed. In 5 I beleive it is necessary to add column styles for all wanted columns, all beeing trivial (also for the expression columns), except the DataGridComboBoxColumnStyle which will be a bit more tricky (but I am confident I have control on this)

Please tell me where I am making wrong assumptions, and _please_ post me a dataset xsd file with all features above that works. I am going mad trying but to no avail, and the recursively ad infinitum "read the rest somewhere else" microsoft documentation is only making it worse.

Much Appreciated

Dataset Summary

Given two tables
Customer Table:
CustomerID - integer, primary key, no nulls allowe
CustomerName - string, uniqu
CustomerAddress - string, free tex
CustomerTotalOrderPrice - Expression = Sum( Child(CustomerOrder).OrderUnitPrice * Child(CustomerOrder).OrderQuantity

Order Table
OrderID - integer, primary key, no nulls allowe
OrderName - string, free tex
OrderQuantity - intege
OrderUnitPrice - decima
OrdersCustomerID - integer, required, DataGridComboBoxColumnStyle used for selection of CustomerID displaying CustomerNam
OrderTotalPrice - Expression = OrderUnitPrice * OrderQuantity
OrderCustName - Expression = Parent(CustomerOrder).CustomerNam

Relations
CustomerOrder: OrdersCustomerID refers to existing CustomerID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top