Solved

Typed dataset and datarelation

Posted on 2004-08-10
6
461 Views
Last Modified: 2012-06-27
Hi Experts,

I build a typed dataset with Visual Studio.
All tables are dynamically generated, so I can use them in my code.

But datarelations don't appear. Is it normal ?
Or the only way is to use .Relation[string relationname] object.

I want to know if a datarelation is built dynamically by VS or not.

Thanks.
0
Comment
Question by:noulouk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 10

Expert Comment

by:eternal_21
ID: 11766654
This is normal.  The DataRelation is built by the MSDataSetGenerator, but declared as private.
0
 
LVL 9

Author Comment

by:noulouk
ID: 11766726
Thanks eternal 21.
So you mean the datarelation isn't generate dynamically and finally the only way is to use .Relation[string relationname] object.
0
 
LVL 10

Accepted Solution

by:
eternal_21 earned 500 total points
ID: 11766874
The DataRelation *is* generated dynamically, but it is generated as a private variable, and is thus not accessable from outside of the DataSet class.  You are correct that the only way to use it is through the DataSet.Relations property.

It's too bad the Microsoft didn't have the generator create public properties for each of the Relations, as they do for the DataTables!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:noulouk
ID: 11766954
I'm agree with you.
Hope it will change in future version.
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 11767136
You could always edit your DataSet.cs file (produced by the generator), and set the Build Action of your DataSet to None (or remove it from your project), and then add your own public properties and methods.
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 11767144
Don't forget to edit your Visual Studio Solution file, so you can see the .cs file in your project!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unable to connect C# program to an SQL database - Exception occurs. 4 58
Adding items to a C# list incrementally 5 58
orderby list (from Json) 1 28
Selenium and Xpath 4 28
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question