Re: Dataset without a database - editing the .cs file
From: Brad Williams (spam_at_spam.com)
Date: 03/24/04
- Next message: Erik Frey: "Re: BeginLoadData and EndLoadData"
- Previous message: Aaditya: "BeginLoadData and EndLoadData"
- In reply to: C P: "Dataset without a database - editing the .cs file"
- Next in thread: C P: "Re: Dataset without a database - editing the .cs file"
- Reply: C P: "Re: Dataset without a database - editing the .cs file"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 24 Mar 2004 14:13:39 -0800
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
"C P" <nospam@nospam.com> wrote in message
news:eIIerzdEEHA.2640@TK2MSFTNGP09.phx.gbl...
> 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
>
>
- Next message: Erik Frey: "Re: BeginLoadData and EndLoadData"
- Previous message: Aaditya: "BeginLoadData and EndLoadData"
- In reply to: C P: "Dataset without a database - editing the .cs file"
- Next in thread: C P: "Re: Dataset without a database - editing the .cs file"
- Reply: C P: "Re: Dataset without a database - editing the .cs file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|