Testing the Final Result

Now that you've written the template, it's easy to test it out. First you'll need to compile the template, so that CodeSmith Generator will display the right properties in the Properties Window. Click the Build button on the toolbar or press Ctrl+Shift+B to do this. Assuming that there are no errors in the template, you'll see progress messages in the Output Window:

---------------- Compile started -----------------
Build complete -- 0 errors, 0 warnings
---------------------- Done ----------------------
Compile succeeded

If there are any errors in the template, they'll display in the Output Window.

Now you can use the Properties Window to enter values for the template's properties. For the three enumerated properties, you'll find that CodeSmith Generator provides dropdown lists to choose from.

To set the SourceTable property, click in the property value. CodeSmith Generator will display a builder button with three dots. Click the builder button to open the Table Picker dialog box.

Here you can select the data source, and the table within that data source, to use with the template. You can also click the builder button next to the Data Source combo box to create new data sources. After choosing a table, click the Select button to return to the editor.


When you're done setting properties, click the Generate toolbar button or press F5 to run the template. CodeSmith Generator will generate the template's output and switch to the Output tab so that you can save or copy the output.

More Information:

SchemaExplorer

Building, Running, and Compiling Templates