posts - 218, comments - 222, trackbacks - 68

My Links

News




I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net) and born in Bangladesh.
I work for Ocean Informatics Pty Ltd as a Senior Developer - Analyst.
I am also co-founder and core developer of Pageflakes (acquired by LiveUniverse) www.pageflakes.com
and most recently created SmartCodeGenerator

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
Smart Code Generator .NET: Usage Overview
Smart Code Generator .NET: Architectural Overview
Smart Code Generator .NET: using with NAnt and Cassini

Archives

Free Programming Language Training

Example 4: SmartCodeGenerator (asp.net 2.0) Generating Class from SqlServer TableSchema

Download the CommunityDrop1 from here.
Example 4 Generating Class from SqlServer TableSchema

Step1 Opening Existing Template

Open Example4 from Example_Projects folder, as a website project in Visual Studio 2005.

Step2 Launching the Generator

Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page.

Put your connection string in the connectionstring field and Click Scan Button. If the connectionstring is ok and this can connect to the database it will load the table list available in the Database.

Step3 Generating the Text or Code

Select desired tables and simply click the Generate Button. And this will generate code for you. In this case I selected 5 tables Job, JobDataValue, JobHost and JobLog.

Step6: Review the Generated Code.

The class for Job looks like this.

Step7: Review the Profile section in web.config you will notice I have used a custom datatype

<add name="Sql_Tables" type="SmartCodeGen.WebUtil.PropTypes.ScSqlTablesProperty" serializeAs="Xml" />

In future articles and Examples I ll show how to extend SmartCodeGenerator Framework Map different .Net Objects to UIProperty and how to write your custom UI.

Print | posted on Saturday, November 25, 2006 10:16 AM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 3 and 5 and type the answer here:

Powered by: