posts - 234, comments - 480, trackbacks - 56

My Links

News




I am born in Bangladesh and currently live in Melbourne, Australia. I am a co-founder and core developer of Pageflakes www.pageflakes.com and CEO at Simplexhub, a highly experienced software development company based in Melbourne Australia and Dhaka, Bangladesh. 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.

I also created SmartCodeGenerator

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
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 A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: