"Master-Detail" binding though "m-m relation" tables, 3 DataGridVi

"Master-Detail" binding though "m-m relation" tables, 3 DataGridVi

Post by cnljaGx5bU » Fri, 09 Jan 2009 02:52:09


Hello!

I would need to learn some "good practices" in binding of Datasets to forms
using WinForms and Visual studio.

have e.g. persons, roles and actions (I would need at least 2-level-depth
master-detail to understand perfectly)
example (1..n) tables called Persons(PersonID,...) Roles(RoleID,...)
Actions(ActionID,...)

and the task was to see three datagridviews and if position in person
gridview is changed , the roles gridview will be refreshed. And by changing
position in roles gridview the actions gridview is refreshed.

solution: no problem -
It is working without writting any code, only need is to drag the right
tables or relations from the dataview to the form pane. The VS will generate
code with correct bindingsource objects.


But consider similar task with "m-n relations" between tables. (so there
will be next two tables PersonRole(PersonId, RoleId) RoleAction(RoleId,
ActionId)
I started with dragging Person table, then continue by dragging PersonRole
"relation" within Person table. So far no problem - binding works perfectly
for generated two gridviews.
But I can't somehow find a way, how to create with "good or best practices"
the last action table gridview (with at least ActionId column).
I guess I need to set the gridview's DataSource property to binding source
from the previous gridview?? Or need I any different aproach to accomplish
the task?

Thanks in advance,
M.Rychly.
 
 
 

1. Getting rid of Control M's generated when Programs output advisory to emacs command shell

2. Set::setps error? Twitter.m's OOP-like approach?

ou might try with this "overloading" approach:

{NAME, BALANCE} = Range[2];
ClearAll[Account, create, getName, getBalance, deposit];
Account /: (f_[p___, Account[t_, n_], m___] /;
MemberQ[{Plus, Subtract, Times, Divide, Power}, f]) :=
Account[t, f[p, n, m]];
create[name_, balance_] := Account[name, balance];
getName[account_Account] := account[[NAME]];
getBalance[account_Account] := account[[BALANCE]];
deposit[account_Account, amount_] := account = account + amount;

This is the resulting behavior:

In[8]:= a=create["test",Random[Integer,{0,200}]]
Out[8]= Account(test,176)

In[9]:= getBalance[a]
Out[9]= 176

In[10]:= b=a+10
Out[10]= Account(test,186)

In[11]:= b=a 10
Out[11]= Account(test,1760)

In[12]:= b=10a
Out[12]= Account(test,1760)

In[13]:= b=a/10
Out[13]= Account(test,88/5)

In[14]:= b=10/a
Out[14]= Account(test,5/88)

In[15]:= b=a^2
Out[15]= Account(test,30976)

In[16]:= deposit[a,25]
Out[16]= Account(test,201)

In[17]:= deposit[b,25]
Out[17]= Account(test,31001)

In[18]:= a
Out[18]= Account(test,201)

In[19]:= b
Out[19]= Account(test,31001)

ADL


On Nov 3, 8:58 am, Erik Max Francis < XXXX@XXXXX.COM > wrote:
tica/
a
t


3. Getting rid of Control M's generated when Programs output advisory to emacs command shell

4. whats up with the Pentium M's

5. Repost: Jeff M's SBS 2003 Migration Process

6. ssh with -t outputs additional ^m's

7. Can i find all my m's file required function and save them is a folder

8. M's JSON parser v1.2 released

9. M's Lemma: For all primes p let 6=283

10. UTF16 and Control M's

11. Set::setps error? Twitter.m's OOP-like approach?

12. ^M's and joining lines

13. Jeff M's SBS 2003 Migration process

14. Fetch data on ClientDataSet Master-Detail relation

15. Master-detail relation with TIBClientDataset ?