posts - 236, comments - 436, trackbacks - 56

My Links

News

Awarded Microsoft MVP C#.NET - 2007, 2008 and 2009


I am born in Bangladesh and currently live in Melbourne, Australia. I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net)and born in Bangladesh.
I am founder and Chief Executive Officer of
Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. Co-founder and core developer of Pageflakes www.pageflakes.com.
Simplexhub, is on its mission to build a smart virtual community in Bangladesh and recently launched beta realestatebazaar.com.bd an ASP.NET MVC application written in C#.NET.


Some of My Articles
Flexible and Plugin based .Net Application..
Mass Emailing Functionality with C#, .NET 2.0, and Microsoft® SQL Server 2005 Service Broker'
Write your own Code Generator or Template Engine in .NET

Archives

Free Programming Language Training

How to write DBSchemaProvider for SmartCodeGenerator

SmartCodeGenerator Implements Asp.Net ProviderPattern and DBSchemaProvider class comes with the following signature.

public abstract class DBSchemaProvider : ProviderBase
{
      // Methods
      protected DBSchemaProvider();
      public abstract ParameterSchemaCollection GetCommandParameters(CommandSchema command);
      public abstract CommandResultSchemaCollection GetCommandResultSchemas(CommandSchema command);
      public abstract CommandSchemaCollection GetCommands(DatabaseSchema database);
      public abstract string GetCommandText(CommandSchema command);
      public abstract string GetDatabaseName(DatabaseSchema database);
      public abstract string GetDescription();
      public abstract ExtendedPropertyCollection GetExtendedProperties(SchemaBase schemaObject);
      public abstract string GetName();
      public abstract ColumnSchemaCollection GetTableColumns(TableSchema table);
      public abstract DataTable GetTableData(TableSchema table);
      public abstract IndexSchemaCollection GetTableIndexes(TableSchema table);
      public abstract TableKeySchemaCollection GetTableKeys(TableSchema table);
      public abstract PrimaryKeySchema GetTablePrimaryKey(TableSchema table);
      public abstract TableSchemaCollection GetTables(DatabaseSchema database);
      public abstract ViewColumnSchemaCollection GetViewColumns(ViewSchema view);
      public abstract DataTable GetViewData(ViewSchema view);
      public abstract ViewSchemaCollection GetViews(DatabaseSchema database);
      public abstract string GetViewText(ViewSchema view);
      public static DBSchemaProvider Instance();
      public static DBSchemaProvider Instance(string providerName);
}
All you have to do is implement all these methods for any specific DBSchemaProviders.
For an implementation of MySqlDBSchemaProvider please refer
to this post at Team Blog of SmartCodeGenerator.
You can also download the same sourcecode from CodePlex.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Sunday, December 10, 2006 3:45 AM |

Feedback

Gravatar

# re: How to write DBSchemaProvider for SmartCodeGenerator

Hi,

Finally someone is doing a proper code generator in ASP.NET. I haven't checked through all of the details, but from all I see this could become a better tool than CodeSmith.

We are heavy users of CodeSmith, but due to a) the to high price (with bait and switch of it being free for quite some time) and b) not enough VS.NET integration, we are looking for a replacement.

I have some questions:
- Can we execute smart code generator in batch mode, and if so how and what are the dependencies?
- When is the 1.0 release version planned?
- What are your plans in terms of releasing the code?

Regards,

Ralf
12/13/2006 1:33 AM | Ralf Haug
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: