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 / .NET Framework / ADO.NET / March 2004

Tip: Looking for answers? Try searching our database.

Dataset without a database - editing the .cs file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
C P - 24 Mar 2004 21:13 GMT
Background:  I'm net to .NET and using C#.

I see that I can create an .xsd file at VS.NET will create a corresponding
C# class for me that is a corresponding dataset to my .xsd schema.  This
seems perfect for the class I want to construct.  I'd like to have consumers
of my Dataset class be able to access my class as a Dataset.  I know this
can all be done.  However, I'd like to extend the Dataset class that is
autogenerated from my schema to add some functionality.  Is there a safe way
to do this?  Or, will any change to the DataSet's schema cause the
underlying class to be re-written and thus lose all my code?  I suppose I
could add my code to a subclass of the DataSet class...  Is what I'm
attempting a bad idea?  Is there a better way to approach this?

Thanks,
Chris
Brad Williams - 24 Mar 2004 23:13 GMT
Yes, changes to generated code will be lost.

You could probably inherit from the dataset class.  But that might not be
the best choice, because if you are adding some business logic, then your
new class will probably be "more than" a dataset ... it will be something
you might call a "data access component" or "business component", which
*uses* a dataset.  So maybe consider creating a new class that contains the
dataset as one private field in it.  It depends on the meaning of the
functionality you want to add, and on the scope of the project.

Brad Williams

> Background:  I'm net to .NET and using C#.
>
[quoted text clipped - 11 lines]
> Thanks,
> Chris
C P - 25 Mar 2004 01:16 GMT
Thanks,

I decided to create my own class with my dataset as a private member.  My
class will restrict access to only the relevant properties of the underlying
dataset, and I'll put the additional required functionality in my own class.

> Yes, changes to generated code will be lost.
>
[quoted text clipped - 25 lines]
> > Thanks,
> > Chris

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.