Search Articles :
 
HyperLink

 
Latest Articles
Using the Wizard control of ASP.NET
Using Site Maps to provide web site navigation
Using Extension Methods
Working with Binary Large Objects (BLOBs) Using SQL Server and ADO.NET
Using LINQ in ASP.NET (Part 4)
Tip: Fetching Random Rows From SQL Server
Using LINQ in ASP.NET (Part 3)
Using LINQ in ASP.NET (Part 2)
Using LINQ in ASP.NET (Part 1)
Getting Started with IIS7 (Part 2)
 
Latest Blog Posts
Thought of the day
भाग 9 : नवी साधना व उत्स्फुर्त क्रिया
भाग 8 : मी परत येतो
भाग 7 : अद्भुत स्वप्न आणि दीक्षा
भाग 6 : कुंडलिनी जागृती
भाग 5 : त्र्यंबकेश्वरला दाखल
Using Extension Methods
Working with Binary Large Objects (BLOBs) Using SQL Server and ADO.NET
भाग 4 : मी नोकरी सोडतो
Using LINQ in ASP.NET (Part 4)
   

Developer's Guide to ASP.NET 3.5
Master ASP.NET 3.5 development using C# and Visual Studio.NET 2008. Web forms, server controls, data binding, AJAX, ASMX and WCF services and more...
Beat stress - learn Kriya Yoga Meditations
A six week online course in our style of Kriya Yoga is available absolutely FREE. Very few websites teach you the ancient art and science of Kriya Yoga in such a systematic and authentic manner.

BinaryIntellect Code Generator (Beta)

BinaryIntellect code generator is a handy tool that automatically generates T-SQL script and C# code for Insert Update, Delete, Select All, Select By Primary Key, Select By Foreign Key and Delete By Foreign Key stored procedures. 100% of the code generated by the tool is available for you to include in your projects. No dependency or hidden strings attached! By default the generated code uses an in-built data access class. However, with a very little modification it can be made to use Microsoft Data Access Application Block. The tool will be available absolutely FREE of cost after the final release.

Features

BinaryIntellect code generator is a handy tool that automatically generates T-SQL script and C# code for the following stored procedures:
  • Insert
  • Update
  • Delete
  • Select All
  • Select By Primary Key
  • Select By Foreign Key
  • Delete By Foreign Key

100% of the code generated by the tool is available for you to include in your projects. No dependency or hidden strings attached! By default the generated code uses an in-built data access class. However, with a very little modification it can be made to use Microsoft Data Access Application Block. The tool will be available absolutely FREE of cost after the final release.

Known limitations and issues

The Beta version of the tool has following known limitations and issues:

  • Table and column names with white spaces are not supported
  • Foreign key constraint must be named as <anyname>_<name_of_the_parent_table>. This is how SQL Server creates them by default. It must end with "_" character followed by the name of the parent table.
  • The tool works only with SQL Server databases
  • Currently code is generated only in C#
  • Only single column primary keys are supported
  • Only single foreign key supported while generating "Select By FK" and "Delete By FK" procedures 

Features that will be added in the final version 

We plan to include the following additional features in the final release :

  • Support for VB.NET code generation
  • Support for table and column names with white spaces

Help us make it better

The BinaryIntellect Code Generator is still in beta stages. We will be releasing the final version soon. You can help us make it better by downloading and trying it out. Kindly send us any bugs, errors or suggestions here.  Also, if you feel that the tool is useful to developers like you then tell your friends about it.

Sample T-SQL generated by the tool

create procedure EmployeesAdd(@FirstName varchar(50),
@LastName varchar(50))
As
insert into Employees(FirstName,LastName)
values(@FirstName,@LastName)
Go
create procedure EmployeesModify(@EmployeeID int,
@FirstName varchar(50),@LastName varchar(50))
As
update Employees set FirstName=@FirstName,LastName=@LastName where EmployeeID=@EmployeeID
Go
create procedure EmployeesRemoveByPK(@EmployeeID int) 
As
delete from Employees where EmployeeID=@EmployeeID
Go
create procedure EmployeesGetAll 
As
select * from Employees
Go
create procedure EmployeesGetByPK(@EmployeeID int) 
As
select * from Employees where EmployeeID=@EmployeeID
Go

Sample C# Code generated by the tool

using System;

using System.Data;

using System.Data.SqlClient;

 

namespace Company.HR

{

public class Employees

{

public static int Add(string FirstName,string LastName)

{

SqlParameter[] p=new SqlParameter[2];

p[0]=new SqlParameter("@FirstName",FirstName);

p[1]=new SqlParameter("@LastName",LastName);

return SqlHelper.ExecuteNonQuery("EmployeesAdd",p);

}

 

public static int Modify(int EmployeeID,
string FirstName,string LastName)

{

SqlParameter[] p=new SqlParameter[3];

p[0]=new SqlParameter("@EmployeeID",EmployeeID);

p[1]=new SqlParameter("@FirstName",FirstName);

p[2]=new SqlParameter("@LastName",LastName);

return SqlHelper.ExecuteNonQuery("EmployeesModify",p);

}

 

public static int RemoveByPK(int EmployeeID)

{

SqlParameter[] p=new SqlParameter[1];

p[0]=new SqlParameter("@EmployeeID",EmployeeID);

return SqlHelper.ExecuteNonQuery("EmployeesRemoveByPK",p);

}

 

public static DataTable GetAll()

{

System Requirements

  • .NET Framework 2.0
  • Access to SQL Server database for which the code is to be generated

Installation Instructions



Associated Links
Download Code Generator

Posted On : 28 Nov 2006
Current Rating :
Rate This Article :

About the Author
Bipin Joshi
Bipin Joshi is the proprietor of BinaryIntellect Consulting where he conducts premier training programs on .NET technologies. He wears many hats including software consultant, mentor, prolific author, webmaster, Microsoft MVP and member of ASPInsiders. Having adopted Yoga way of life Bipin also teaches Kriya Yoga to the interested individuals. His detailed profile can be read at his blog. He can also be reached there.


Post your comments

Your Name :

Your Web Site (Optional) :

Subject :

Comments :


Comments
Code Generator Beta
Is the Code Generator still in Beta & if so, are you planning a final release? Do you have any timing? Will the source be available to modify to customise what is generated?
Posted By : KK Posted On : 6/20/2007
Re: Code Generator Beta
Yes. It is still in beta. Though there is no fixed time line we are expecting it around 2-3 months from now (which may get extended based on the release date of Orcas and new developments). Currently there are no plans to release the source code.
Posted By : Bipin Joshi Posted On : 6/21/2007
One Suggestion
Hi dear Bipin Joshi,
it is Cool! but has lack a feature.I have a suggestion that is very important (in my opinion).
imagin that i want to make one stored procedure that update some fiels of one table.
if you add a part to the program that show list of columns of table with Checkbox beside of any column,
when user Checked some checkbox, program Generats exactly purposed stored proceduer.
Best Regards
Posted By : Morteza Posted On : 12/14/2007
Copyright (C) BinaryIntellect Consulting. All rights reserved.
Contact Us
Read Terms Of Use
Windows Server Hosting by ORCS Web