Click here to Skip to main content
13,198,482 members (64,506 online)
Click here to Skip to main content
Add your own
alternative version


34 bookmarked
Posted 16 Dec 2003

Simple C# codegenerator for DB objects (table, store procedure)

, 7 Mar 2005
Rate this:
Please Sign up or sign in to vote.
This small utility generates code to call store procedure or C# class from Table
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS-->

Sample Image - gener.jpg


This is a simple utility i wrote after working on a big project.

After i had to manually create code to call store procedures and every time i had to switch back and forth between Edit screen and database screen to find out necessary parameters, their types, and length i started to look for the wizard which will do it automatically.

After goggling for about 30 minutes i could not find anything but one tool for which author was asking $60 and trial version i downloaded did not work correctly (or in some cases would give GPF ) i decided to spend couple hours.

Since i am a C# programmer the code is generated is C# code. Also if you are using different naming convention than i am you may have to modify the source.

For some, totally unknown for me, reason i wrote the tool in VB 6 not in C#. Do not know why. But i did it :).

Anyway download demo project and give it a try.



1. First you will have to provide connection string to your SQL server. Copy and paste it from existing project.
IMPORTANT: Connection string must be in ADO format. Not ADO.NET. Example: Provider=SQLOLEDB.1;Password=pwd;Persist Security Info=True;User ID=sa;Initial Catalog=Database;Data Source=GTL

Do not be afraid program will remember it. So next time you bring it up it will have that string.

2. Choose an action and click generate. Or you can "Generate All" to generate code for all possible actions.

3. The program is totally unintelligent ( i spent only couple hours to work on it) and you will have to modify the code it generates (especially for and Update store procedure WHERE clause). But it serves it's purpose most tedious work is taken care of.





Thanks and enjoy.

Feel free to modify source code.

Email:  (remove 'spam' from my email)

Gevorg Ter-Saakov.

Body Jewelry. Labrets, Barbells, Nose screws, Piercing supply



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
I am a Senior Software developer who does a consulting work for several companies. Mostly it's an E-Commerce project.

I do have my own venture. Small online store my wife runs. Body Jewelry. Also visit Piercing info Cool thing is that nor I nor my wife has any piercings. My new website is Belly ring

You may also be interested in...

Comments and Discussions

QuestionWhy should we use Code Generators? Pin
Iqbal M Khan15-Feb-07 1:43
memberIqbal M Khan15-Feb-07 1:43 
Generalhi Pin
man_chat22-Dec-06 2:59
memberman_chat22-Dec-06 2:59 
Generala better option Pin
krausscarlos28-Jul-06 6:47
memberkrausscarlos28-Jul-06 6:47 
Generalms access query and C# Pin
shaw_luo27-Sep-04 21:27
membershaw_luo27-Sep-04 21:27 
GeneralDALMaker.NET Pin
TLWallace29-Dec-03 14:17
memberTLWallace29-Dec-03 14:17 
QuestionVB? Pin
Daniel Fisher (lennybacon)22-Dec-03 8:36
memberDaniel Fisher (lennybacon)22-Dec-03 8:36 
AnswerRe: VB? Pin
gevorg22-Dec-03 12:57
membergevorg22-Dec-03 12:57 
GeneralRe: VB? Pin
ralphw23-Dec-03 3:14
memberralphw23-Dec-03 3:14 
GeneralRe: VB? Pin
gevorg23-Dec-03 15:01
membergevorg23-Dec-03 15:01 
GeneralRe: VB? Pin
Daniel Fisher (lennybacon)23-Dec-03 9:20
memberDaniel Fisher (lennybacon)23-Dec-03 9:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 7 Mar 2005
Article Copyright 2003 by Gevorg
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid