Click here to Skip to main content
16,005,169 members
Home / Discussions / C#
   

C#

 
Questionusing TreeView as a menu Pin
Rocky#6-Feb-07 23:42
Rocky#6-Feb-07 23:42 
AnswerRe: using TreeView as a menu Pin
VirtualVoid.NET7-Feb-07 1:35
VirtualVoid.NET7-Feb-07 1:35 
AnswerRe: using TreeView as a menu Pin
Rizawn7-Feb-07 5:38
Rizawn7-Feb-07 5:38 
GeneralRe: using TreeView as a menu Pin
Rocky#7-Feb-07 19:06
Rocky#7-Feb-07 19:06 
Questionremote Pin
mihksoft6-Feb-07 23:01
mihksoft6-Feb-07 23:01 
QuestionCollection Editor Pin
bobsugar2226-Feb-07 22:32
bobsugar2226-Feb-07 22:32 
AnswerRe: Collection Editor Pin
JoeSharp6-Feb-07 23:15
JoeSharp6-Feb-07 23:15 
QuestionCan't access related tables when using the dataset designer. Pin
akkram6-Feb-07 22:32
akkram6-Feb-07 22:32 
Hello,

I have a problem when using MS Visual Studios 2005 build in DataSet Designer. In my App I want to work with two related tables, one Parent and one Child table.

ParentTable
-----------
ParentID (pk)
ParentName

ChildTable
-----------
ChildID (pk)
ChildName
ParentID (fk)

When I do this the old fashion way (not using the designer), I have no problem accessing the Child records related to the Parent record im working with. Here's the working code:

DataRelation parentChildRelation;
DataColumn colMaster;
DataColumn colDetail;
colMaster = parentChildDataSet.Tables["Parent"].Columns["ParentID"];
colDetail = parentChildDataSet.Tables["Child"].Columns["ParentID"];
parentChildRelation = new DataRelation("parentChildRelation", colMaster, colDetail);
parentChildDataSet.Relations.Add(parentChildRelation);

Now i can access the relation using
parentRow.GetChildRows(relation, DataRowVersion.Default);

But when I do the same thing but using the DataSet designer (adding the two tableadapters for the Parent and Child table and adding a relation between them from the DataSet Toolbox) I can't access the relation in my code.
I have looked in the Designer.cs and it adds the code for the relation:

this.relationParent_Child = new System.Data.DataRelation("Parent_Child", new System.Data.DataColumn[] {
this.tableParent.ParentIDColumn}, new System.Data.DataColumn[] {
this.tableChild.ParentIDColumn}, false);
this.Relations.Add(this.relationParent_Child);

But still a call like this: parentTable.ChildRelations; ends up empty..

Anyone have any idea why?

/Thanks - Martin
Questionclasses in C#.NET Pin
Software_Specialist6-Feb-07 22:23
Software_Specialist6-Feb-07 22:23 
AnswerRe: classes in C#.NET Pin
aSarafian6-Feb-07 22:53
aSarafian6-Feb-07 22:53 
GeneralRe: classes in C#.NET Pin
Software_Specialist6-Feb-07 23:12
Software_Specialist6-Feb-07 23:12 
GeneralRe: classes in C#.NET Pin
netJP12L7-Feb-07 5:33
netJP12L7-Feb-07 5:33 
QuestionClearing cache in webbrowser control Pin
engsrini6-Feb-07 22:21
engsrini6-Feb-07 22:21 
QuestionMy own application and My own extension-how to add in Registry? Pin
GunaChinna6-Feb-07 22:13
GunaChinna6-Feb-07 22:13 
QuestionGetting MMS off phone Pin
Andre Trollip6-Feb-07 21:28
Andre Trollip6-Feb-07 21:28 
AnswerRe: Getting MMS off phone Pin
aSarafian6-Feb-07 22:56
aSarafian6-Feb-07 22:56 
GeneralRe: Getting MMS off phone Pin
Andre Trollip7-Feb-07 0:47
Andre Trollip7-Feb-07 0:47 
GeneralRe: Getting MMS off phone Pin
aSarafian7-Feb-07 1:16
aSarafian7-Feb-07 1:16 
Questionplz help me Pin
Member 38035816-Feb-07 21:12
Member 38035816-Feb-07 21:12 
AnswerRe: plz help me Pin
Christian Graus6-Feb-07 21:20
protectorChristian Graus6-Feb-07 21:20 
GeneralRe: plz help me Pin
aSarafian6-Feb-07 22:59
aSarafian6-Feb-07 22:59 
Questionplease help me!!!! Pin
Member 38035816-Feb-07 21:08
Member 38035816-Feb-07 21:08 
QuestionCan someone make SunClock.net? [modified] Pin
Ken OKABE6-Feb-07 20:54
Ken OKABE6-Feb-07 20:54 
AnswerRe: Can someone make SunClock.net? Pin
Pravarakhya6-Feb-07 20:57
Pravarakhya6-Feb-07 20:57 
AnswerRe: Can someone make SunClock.net? Pin
Ken OKABE6-Feb-07 21:01
Ken OKABE6-Feb-07 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.