Click here to Skip to main content
Licence 
First Posted 16 Dec 2003
Views 58,202
Bookmarked 33 times

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

By | 7 Mar 2005 | Article
This small utility generates code to call store procedure or C# class from Table

Sample Image - gener.jpg

Introduction

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.

 

Documentation

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: gevorgspam@comcast.net  (remove 'spam' from my email)

Gevorg Ter-Saakov.

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

 

License

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

Gevorg

Web Developer

United States United States

Member

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

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionWhy should we use Code Generators? PinmemberIqbal M Khan1:43 15 Feb '07  
Generalhi Pinmemberman_chat2:59 22 Dec '06  
Generala better option Pinmemberkrausscarlos6:47 28 Jul '06  
Generalms access query and C# Pinmembershaw_luo21:27 27 Sep '04  
GeneralDALMaker.NET PinmemberTLWallace14:17 29 Dec '03  
QuestionVB? PinmemberDaniel Fisher (lennybacon)8:36 22 Dec '03  
AnswerRe: VB? Pinmembergevorg12:57 22 Dec '03  
GeneralRe: VB? Pinmemberralphw3:14 23 Dec '03  
GeneralRe: VB? Pinmembergevorg15:01 23 Dec '03  
GeneralRe: VB? PinmemberDaniel Fisher (lennybacon)9:20 23 Dec '03  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web04 | 2.5.120517.1 | Last Updated 7 Mar 2005
Article Copyright 2003 by Gevorg
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid