Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / May 2005

Tip: Looking for answers? Try searching our database.

Designer adds relations to custom datasets

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jose Antonio - 05 May 2005 10:51 GMT
Hi,

I have coded a class which inherits from DataSets and
creates two datatables and a datarelation between them.

My intention is to drag it to a form in order to bind the
dataset to several controls.

When I drag the dataset to the form, the designer
automatically adds code in the InitializeComponent method
to create the relation between the tables and adds it to
the dataset.

Obviously, as the DataSet already contains the relation
when the app runs it crashes with the error that the new
relation is already created in the dataset.

Any idea of how can I avoid this behaviour of the winform
designer?

Thanks in advance.

Jose Antonio.
Jose Antonio - 05 May 2005 12:38 GMT
Checking the code of a typed DataSet I have found that in
the class that inherits form DataSet,
methods "ShouldSerializeTables"
and "ShouldSerializeRelations" must be overriden returning
false.

I have done this change in my code and it works perfectly.

Jose Antonio.
>-----Original Message-----
>Hi,
[quoted text clipped - 21 lines]
>Jose Antonio.
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.