Eric J. Smith's Weblog

CodeSmith, .NET, etc...

June 2005 - Posts

Is Dynamic SQL in Your Stored Procedures Vulnerable to SQL Injection?
Is Dynamic SQL in Your Stored Procedures Vulnerable to SQL Injection?

... article. Since writing sprocs as outlined in Erland's article can be tedious, I created a CodeSmith template that will do the work for you. You only need to input the table you wish to query, and CodeSmith will generate a complete sproc for you. ...
Posted: Jun 30 2005, 10:05 PM by ejsmith | with no comments
Filed under: ,
ScriptTableData CodeSmith template that handles Text and NText data

Todd Carrico has posted a really nice modified version of the ScriptTableData.cst template.  It handles text and ntext data types as well as adding some other nice features.

Todd Carrico : ScriptTableData CodeSmith template that handles Text and NText data ]

Posted: Jun 28 2005, 04:28 PM by ejsmith | with no comments
Filed under:
Google Earth!
I just had to say wow!  Google Earth is awesome!
Posted: Jun 28 2005, 02:10 PM by ejsmith | with 3 comment(s)
Filed under:
Rob Howard on .NET Rocks!

My partner Rob Howard also of Telligent Systems is on this weeks episode of the great .NET Rocks! internet talk show where he talks about his years with Microsoft working on the ASP.NET 1.0, 1.1, and 2.0 teams.

http://www.dotnetrocks.com/default.aspx?showID=120

Posted: Jun 27 2005, 10:27 PM by ejsmith | with 1 comment(s)
Filed under:
RTM on top of Whidbey Beta2 (and an ode to Code Generation)!!!

“Our application was just deployed in production on top of Whidbey Beta2!!! In addition to being a Whidbey success story, our application is a showcase for code generation techniques (and the great CodeSmith 2.6). In our DataAccess layer (about 4000 lines of code), a total of 10 lines were written by hand and that too to retrieve DB connection strings from configuration files. If we had been building on top of 1.1, we would have even bigger numbers for autogenerated lines of code) -- Whidbey generics eliminate the need to write code to create specialized collections of objects. In addition, we used xsd schemas to generate partial classes that were later extended using hand written code. If you ask me, creating a XSD file is much easier than defining a class and defining a whole bunch of get / set props (well, arguably the Whidbey IDE makes it trivial, but you get the point). The XSDs were processed using xsd.exe and XsdObjectGen (from MS). Both of these tools generate code from XSD definitions, but they work slightly differently. In addition, we used a couple of small homegrown tools to slightly tweak the output using regex (to change the generated class to "partial" for instance). Also, it's pretty worthwhile to have a tool that generates code intelligently based on some of timestamp mechanism so that build doesn't take a long time.”

[ RTM on top of Whidbey Beta2 (and an ode to Code Generation)!!! ]

CodeSmith Template Datatable Content Example

Dave Burke talks about using CodeSmith to generate type code enums from database table contents.

CodeSmith Template Datatable Content Example

Posted: Jun 27 2005, 09:39 AM by ejsmith | with no comments
Filed under:
CodeSmith Generated Audit Log Triggers

Here is an article on The Code Project about how to use CodeSmith to generate audit log triggers for your database.

http://www.codeproject.com/database/AuditTriggers.asp

Posted: Jun 21 2005, 08:49 PM by ejsmith | with no comments
Filed under:
CodeSmith 3.0 Review

Mike Gunderloy reviews CodeSmith 3.0.

http://www.larkware.com/Reviews/codesmith.html

Posted: Jun 21 2005, 08:36 PM by ejsmith | with no comments
Filed under:
Don't Wait, Save Now!

I really wish I had looked at Codesmith a year ago when it was first recommended to me. If you want to see some of the possibilities, download it, and then download the .NetTiers templates. If you run these you will be amazed not only at the code produced, but the comments, and even the NUnit tests!”

[ http://weblog.vb-tech.com/nick/archive/2005/04/12/671.aspx ]

Posted: Jun 21 2005, 08:35 PM by ejsmith | with no comments
Filed under:
CodeSmith, Consistency and Elegance

“Consistency is its own reward: This fact cannot be overstressed at the project level and has real benefits at the shop level.  Here are a few of the big ones.  Pick a naming convention and stick with it.  This works for code and stored procedures.  It makes it easier for you and others to read your code.”

[ Bill J - Practical Code Patterns ]

Posted: Jun 21 2005, 08:31 PM by ejsmith | with no comments
Filed under:
More Posts Next page »