OT: CodeSmith templates with Root Command

OT: CodeSmith templates with Root Command

Old forum URL: forums.lhotka.net/forums/t/1834.aspx


albruan posted on Monday, November 27, 2006

I have a sproc to flatten my BO hierarchy for reporting purposes.  Distilling it to it's simplest, it's similar to the following:

SELECT EstimateDepartment.DeptName,
     SUM(EstimateDrawing.NumberOfDwgs) AS NumberOfDwgs,
     SUM(EstimateDrawing.ManHoursPerDwg) AS ManHoursPerDwg
FROM EstimateDrawings INNER JOIN EstimateDepartments
ON EstimateDrawings.DeptID = EstimateDepartments.DeptID
GROUP BY EstimateDepartments.DeptName

A typical resultset would be something akin to:

DeptName                          NumberOfDwgs                         ManHoursPerDwg
Architectural                                  10                                                 12.5
Electrical                                        15                                                   7.5

So, my sproc works as planned.  Where I'm having problems is trying to get the CodeSmith template for a Read-Only Child to work with it.  I've selected the sproc as being the Root Command and the DeptName as being the Unique Column to reference in building the BO.  Nonetheless, CodeSmith insists that I need to name a Unique Column in order to build the BO and it has me a bit confused as each DeptName appears only once in the resultset.

Can anyone spot if I'm doing something wrong?  BTW, the templates I've been using were downloaded in August.

rasupit replied on Monday, November 27, 2006

This issue has been addressed after v1.0.1.  Try to use the latest version at  http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=CSLAcontrib&ReleaseId=797 or just download from Source Code.

Ricky

albruan replied on Monday, November 27, 2006

Ricky,

I've just downloaded and installed the new templates at codeplex.com, but I still get the same error message regarding Unique Column(s) being required.

Allen

rasupit replied on Monday, November 27, 2006

Hmm, 
Can you post your stored procedure in its entirety?  Also, make sure you set the ResultSetIndex property to which result set to use from the stored procedure.

Copyright (c) Marimer LLC