Setting up a DataDirectory for Generator Connection Strings

Using a DataDirectory for Generator

You can specify a DataDirectory for CodeSmith Generator to easily share and discover MS SQL Express databases. CodeSmith Generator ships with a version of the Petshop database whose Datasource uses a DataDirectory.

The DataDirectory Path

By default, the DataDirectory folder for CodeSmith Generator is:

Windows 2000/XP: C:\Documents and Settings\<USER NAME>\My Documents\CodeSmith Generator\Samples\<VERSION>\Data

Windows Vista/Windows 7: C:\Users\<USER NAME>\Documents\CodeSmith Generator\Samples\<VERSION>\Data

Customizing the DataDirectory Path

You can customize the path that Generator uses to set up the DataDirectory in the AppDomain. The first step is to open the Generator Options dialog. Once this dialog is open, select the Engine node on the left hand side of the options. 

Finally, look for the CodeSmithDataDirectory Property under the Paths category and select the folder picker. Changing this path to another directory will cause Generator to use the new path the next time Generator starts up.