I would  reckon any one who is interested  in the code gneration,  goes to www.codegeneration.net first, not check the  available tools, but the interview with many code generation tools authors. They talk about what situation they met to use code generation successfully, and the weakness and strength.

IMHO, every developer should know how to develop the code generation tools yourself, rather than use the available commerical tools, because only you as the author who can simply customize your own tools to match your secnairo, and most of the enterprise database application will be a special case need your own customize...Also, don't expect the code gneration to generate the whole application, it is still not in reality.

There is an intervew in the web site with Dave thomas (author of the pramatic programmers), he mentioned he acutally uses ruby a lot to do the code generation work, which can be much simpler than C# or java.

How to make a code generation? There are mostly three ways...
1. RegEx, using regular expression to do the string match and replace
2. Xml as the template and XSLT to convert the variables
3. XDoclet in Java or C# attribute
4. Template engine like NVelocity or stringtemplate, freemarker (java)

I think template is the easiest and manaable way to write your own codes template.
eg as stringtemplate,
you need to create a templat first,

sqlinsert() ::= <<
Insert into $tablefields, sperate=","$
values ($values,seperte=","$)
>>

then write a c# controller class to assign your table schema information to the template
stringtemplate.setattriubte("tablefields", "field1");
stringtemplate.setattriubte("tablefields", "field2");
...