Solved

Typed dataset and datarelation

Posted on 2004-08-10
6
451 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
  • 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now