Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / March 2007

Tip: Looking for answers? Try searching our database.

Parent-Child-Relation and DataView - .net 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rolf Welskes - 23 Mar 2007 14:10 GMT
Hello,
I have the following problem:
I have tableA, tableB
A relation between tableA and TableB.
So table B is the child of table A.
In tableA, tableB may keyX be the foreingn key and Fk_tableA_tableB the
relation.

Now I have a DataView dvA pointed to tableA.
Now I take a bindingSource bs and set:
bs.DataSource = dvA.
Now I set dataGridViewA.DataSource = bs.
Further I set
dataGridViewB.DataSource = bs.Fk_tableA_tableB.

So I get dvA seeing in dataGridViewA (Parent). as dvA.
Further
I see in dataGridViewB the child-rows of a row selected in tableA / dvA/
datagridA .
Fine.
But
now I have dvB a dataView for the child.
I want to use this DataView for my child.
But I do not know how.

Means:
I want for tableA and tableB have dataView dvA to tableA and dvB have to
tableB, but
on the other side I want with dvB not see all Rows of tableB, but only the
child rows of a row of tableA.

What can I do?

Thank you for any help.
Rolf Welskes
Earl - 24 Mar 2007 05:28 GMT
Look up dataview Filter.

> Hello,
> I have the following problem:
[quoted text clipped - 31 lines]
> Thank you for any help.
> Rolf Welskes
WenYuan Wang - 26 Mar 2007 08:11 GMT
Hi Rolf,

According to your description, you want for tableA and tableB have dataView
dvA to tableA and dvB have to tableB, but dvB only see the child rows of a
row of tableA.

I'm afraid there is no relation between two dataviews. To your scenario,  I
suggest you may look up Filter property of BindingSource.

Set dvA for TableA, and add BindingSourceTableA. Set datasoure of
BindingSourceTableA to dvA.
Drag a new BindingSourceTableB onto designer surface, Set datasource of
BindingSourceTableB to dvA, set datamember to "Fk_tableA_tableB".

Type the express (which used for filtering the rows of TableB) into Filter
property of BindingSourceTableB.

Please try this method and let me know whether this is what you need. I'm
glad to assist you.

Hope this helps,
Sincerely,
Wen Yuan
Rolf Welskes - 28 Mar 2007 13:29 GMT
Hello,
thank you for the informations,
it works fine.
Thank you again and best regards
Rolf Welskes

> Hi Rolf,
>
[quoted text clipped - 21 lines]
> Sincerely,
> Wen Yuan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.