Solved

Typed dataset and datarelation

Posted on 2004-08-10
6
455 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Check my code out(2) 2 54
Achieve json result 2 65
Server Error 11 47
Entity Framework 7 32
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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