PC Review


Reply
Thread Tools Rate Thread

Customizing MSDataSetGenerator output in VS2005

 
 
Stig
Guest
Posts: n/a
 
      6th Dec 2005
Hi,

I am using a strongly typed dataset in .Net 2.0, and would like all
tables to inherit from a cusomt datatable class instead of DataTable.
The reason for this is that I want some common code excuted on the row
events, and this I want to implement this once in a Table base class.

ie. instead of having this code generated:

public partial class ActivitiesDataTable : System.Data.DataTable,
System.Collections.IEnumerable {

I would like the tables to inherit from MyDataSet like this:

public partial class ActivitiesDataTable : CustomDataTable,
System.Collections.IEnumerable {


1) How can this be achieved. Is it possible to create a custom
generator that inherits from the MSDataSetGenerator, and override the
parts where the nested table classes are generated ?

2) In what assembly can I find the MSDataSetGenerator to do this?

3) Now that .Net 2.0 MSDataSetGenerator uses partial classes for the
DataSet, table and row classes, I could add my code without having it
overridden, but then I would have to edit each and every table and row
class in the generated dataset.

4) What is the best solution to customize the generated typed datasets
?


Regards

Stig Nielsson

 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      6th Dec 2005
No, you can't tweak MSDataSetGenerator in that way.
Rather check www.codesmithtools.com it has some free templates that you can
modify...

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Stig" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using a strongly typed dataset in .Net 2.0, and would like all
> tables to inherit from a cusomt datatable class instead of DataTable.
> The reason for this is that I want some common code excuted on the row
> events, and this I want to implement this once in a Table base class.
>
> ie. instead of having this code generated:
>
> public partial class ActivitiesDataTable : System.Data.DataTable,
> System.Collections.IEnumerable {
>
> I would like the tables to inherit from MyDataSet like this:
>
> public partial class ActivitiesDataTable : CustomDataTable,
> System.Collections.IEnumerable {
>
>
> 1) How can this be achieved. Is it possible to create a custom
> generator that inherits from the MSDataSetGenerator, and override the
> parts where the nested table classes are generated ?
>
> 2) In what assembly can I find the MSDataSetGenerator to do this?
>
> 3) Now that .Net 2.0 MSDataSetGenerator uses partial classes for the
> DataSet, table and row classes, I could add my code without having it
> overridden, but then I would have to edit each and every table and row
> class in the generated dataset.
>
> 4) What is the best solution to customize the generated typed datasets
> ?
>
>
> Regards
>
> Stig Nielsson
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing date format output Imran Ghani Microsoft Access VBA Modules 5 18th Jun 2009 07:32 AM
Loading Aximp output files into Vs2005 Tools =?Utf-8?B?Sm9obiBPbGJlcnQ=?= Microsoft C# .NET 0 13th Aug 2006 03:50 AM
Customize MSDataSetGenerator in VS.NET 2005 Dirk Microsoft ADO .NET 0 7th Aug 2006 01:39 PM
MSDataSetGenerator Failed Joe Reggae Microsoft ASP .NET 1 23rd Feb 2006 04:38 PM
Customizing MSDataSetGenerator output in VS2005 Stig Nielsson Microsoft C# .NET 3 8th Dec 2005 07:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:04 AM.