2.0 Designer Generated Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Does anyone know if you can modify what the designer will generate for it's
code when using the wizard to create typed datasets? I know I can use
partial classes to override or extend functionality from these generated
classes but I want to be able to modify slightly the rules that the designer
uses to generate it's files, is this possible?

Thanks,
Jesse
 
Jessard,

I never tried it, but I have read somewhere that you can inherit a
generated class for this purpose.

So you have to try that yourself or somebody should acknowledge this.

Cor
 
Yes, you can, but I would consider inheritance instead. Reason: If you need
to rerun the "custom tool" to update the XSD, you will dump everything you
added to the generated class file, as the tool assumes you did not muck with
its stuff.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
Thanks Greg and Cor for your responses,
I appreciate the help.

Just to let you know, I don't want to inherrit because this means
hand-coding overrides to match any database changes that I have made. If I
make a database change, I want to be able to regenerate the XSD and
tableadapter classes etc with the tool. All I want to modify in the designer
generated output is put System.Nullable before properties of the datarow
where the XSD requires a value (ie. minoccurs > 0).

If i override these by hand, it defeats the purpose, as I will still need to
code the properties of the datarow by hand.

Greg, you say it can be done, can you tell me how please?

I would be very interested to know.

Jesse
 
Back
Top