Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Generate C# class code for table Expand / Collapse
Author
Message
Posted Wednesday, June 8, 2011 3:58 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 2:18 AM
Points: 1,180, Visits: 2,650
Even simpler with Auto-Implemented Properties in C# 3.0 and later you don't need the private variable.

See http://msdn.microsoft.com/en-us/library/bb384054.aspx


--
Nigel
Useful Links:
How to post data/code on a forum to get the best help
The "Numbers" or "Tally" Table - Jeff Moden

Post #1121598
Posted Thursday, September 6, 2012 6:53 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, May 29, 2014 1:06 PM
Points: 30, Visits: 172
Codesmith http://www.codesmithtools.com may be a little easier.

We use MyGeneration http://www.mygenerationsoftware.com.
It is a little dated, but the templates allow scripting in vbscript, VB.Net, or C#. You can also build forms to pick and choose options for your class as you need them.







"There is nothing so useless as doing efficiently that which should not be done at all." - Peter Drucker
Post #1355269
Posted Thursday, September 6, 2012 7:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, September 11, 2012 8:06 PM
Points: 8, Visits: 25
nice bit of code, always like being able to have different ways to do stuff. I made my own c# program about a year ago and I use it regularly. It also creates the stored proc to go with the class. Everyone/anyone feel free to download and check it out here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8681&lngWId=10
Post #1355684
Posted Monday, January 21, 2013 2:51 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, January 27, 2013 9:35 AM
Points: 3, Visits: 5
Free tool in this link

Generates three tier classes and sql CRUD scripts

https://skydrive.live.com/#cid=ACCFC2483F700A04&id=ACCFC2483F700A04%2111751

or

http://rapidshare.com/files/2096091764/ClassCreator%201.0.zip
Post #1409722
Posted Sunday, January 27, 2013 9:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, January 27, 2013 9:35 AM
Points: 3, Visits: 5
Test this free tool

Creates classes and SQL CRUD Scripts

http://rapidshare.com/files/2096091764/ClassCreator%201.0.zip

or

https://skydrive.live.com/#cid=ACCFC2483F700A04&id=ACCFC2483F700A04%2111751
Post #1412137
Posted Thursday, December 26, 2013 3:35 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, August 18, 2014 12:54 AM
Points: 459, Visits: 262
great topic. no chance to test the code right now (have only mobile phone now) but how does the script behave if we have to specify the schema? we could always have many Contact tables in many schemas :)



Kindest Regards,

Damian Widera
SQL Server MVP,
MCT, MCSE Data Platform, MCSD.NET
Post #1526058
Posted Thursday, January 30, 2014 3:36 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, January 30, 2014 3:34 PM
Points: 4, Visits: 42
Is it just me, or does it have problems with multi-word fields like [Field Order]?
Post #1536576
Posted Tuesday, March 25, 2014 10:27 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, May 28, 2014 6:27 PM
Points: 62, Visits: 24
I suppose one could write this in C# itself as well using the SMO classes. String operations are a bit more, uh, pleasant in C#.
Post #1554579
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse