Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Typed DataSet and Relationship Name
 

Typed DataSet and Relationship Name

I am wondering if there is a way to display the Relationship names in the intellisense like the Table and Column Names.
Any ideas....

Thanks,
rythm



rythm  Saturday, September 10, 2005 1:17 AM
This might not directly answer your questions, but in .NET 2.0 Typed Dataset automatically create Methods for retrieving child rows by relation - which are displayed in Intellisense of couse:

When creating two Tables, MyMainTable and MyRelatedTable, and bind them together with a Relation, which is called MyMainRelation, your Instance of MyMainTable will display the following Method:

myMainTable1.GetMyRelatedTableRowsByMyMainRelation();

So if you ask because you want to be sure that your Relation exists and you dont want to use the Relation Name String, this might help you...


Regards,
Thomas
eclipse2k  Sunday, September 11, 2005 3:06 PM
This definetly does not answer my question.  Just so that you know, in .NET 1.1 you can get the related rows too, without specifying relationship name as long as the relationship is defined properly.

I am trying to access the Relationship name because in certain code I need the name alone not the related rows.

Thanks.
rythm  Monday, September 12, 2005 2:05 AM
Sorry, this doesn't really answer your question either: I don't believe there's a way to find these names in intellisense.

You can find them programmatically, though:

NorthwindDataSet ds = new NorthwindDataSet();
foreach (DataRelation relation in ds.Relations)
{
  MessageBox.Show(relation.RelationName);
}
   -Scott

Scott Berry  Thursday, September 22, 2005 6:12 PM
You are right it does not.  Thanks for giving it a thought.  It is just that I prefer using Property Names instead of "Strings" to avoid errors and thus was trying to find thsi.
rythm  Thursday, September 22, 2005 7:35 PM
You have the relationship name available in the partial class, you can make them public in that partial class
Luis
Lucho_1981  Wednesday, July 29, 2009 3:20 PM

You can use google to search for other answers

Custom Search

More Threads

• Combobox in DataGridView with row dependent list
• Databinding of a Textbox
• Custom scrolling of DataGridView
• datagrid click event is not firing
• Combobox bound to an ArrayList in databound grid
• UserPreferenceChangedEventHandler
• Selecting multiple items in list box after retrieving the values from the database
• Updating Tables with Programmatically Edited selected rows via a datagrid
• gridview column header with images in c#
• custom data source Problem