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 / Windows Forms / WinForm Data Binding / February 2006

Tip: Looking for answers? Try searching our database.

Name of the child table with Master/Details configuration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antoni Gomez - 21 Feb 2006 11:19 GMT
Hi.

I need to know the name of the child table with Master/Details
configuration.
This child table is binding with DataGridView
The DataSource of this DataGirdview is a Child BindingSource control.

I have used various techniques but I can not resolved it.

How Can I find the name of the asociated's table of the grid?.

Thanks for your help.

Antoni Gomez
Bart Mermuys - 21 Feb 2006 18:27 GMT
Hi,

> Hi.
>
> I need to know the name of the child table with Master/Details
> configuration.
> This child table is binding with DataGridView
> The DataSource of this DataGirdview is a Child BindingSource control.

Try:

CurrencyManager cm =
(CurrencyManager)BindingContext[dataGridView1.DataSource,
dataGridView1.DataMemer];
Console.WriteLine( cm.GetListName(null) );

HTH,
Greetings

> I have used various techniques but I can not resolved it.
>
[quoted text clipped - 3 lines]
>
> Antoni Gomez
Antoni Gomez - 22 Feb 2006 07:05 GMT
Hello Bart, thanks for your help.

I apply your code in VB, but the object CurrencyManager hasn't the method
GetListName.

This code is :

Dim cm As CurrencyManager = CType(Grid.BindingContext(Grid.DataSource,
Grid.DataMember), CurrencyManager)

Thanks.
Antoni Gomez

> Hi,
>
[quoted text clipped - 22 lines]
>>
>> Antoni Gomez
Bart Mermuys - 22 Feb 2006 08:18 GMT
Hi,

> Hello Bart, thanks for your help.
>
[quoted text clipped - 5 lines]
> Dim cm As CurrencyManager = CType(Grid.BindingContext(Grid.DataSource,
> Grid.DataMember), CurrencyManager)

Yeah, you're right, my mistake it's protected.   Try this instead:

Dim cm As CurrencyManager = CType(Grid.BindingContext(Grid.DataSource,
Grid.DataMember), CurrencyManager)
Dim list As ITypedList = CType(cm.List, ITypedList)

Console.WriteLine( list.GetListName(Nothing) )

HTH,
Greetings

> Thanks.
> Antoni Gomez
[quoted text clipped - 25 lines]
>>>
>>> Antoni Gomez
Antoni Gomez - 24 Feb 2006 06:22 GMT
Hello
This code works fine and I resolved my problem.

Thanks a lot.

Antoni Gomez

> Hi,
>
[quoted text clipped - 48 lines]
>>>>
>>>> Antoni Gomez

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.