Solved

Typed dataset and datarelation

Posted on 2004-08-10
6
460 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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