CSLA Contrib - c# CodeSmith Templates

CSLA Contrib - c# CodeSmith Templates

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


Jack posted on Monday, November 03, 2008

I am having some issues generating a source file when using a stored proc as my datasource vs. a view.  When I check my CodeSmith Schema Explorer (Oracle Database) I can navigate to my command, see my sproc and see the input / output variables (output is a refcursor).  The field in question is clearly defined as a varchar2(20).  The recursor is (select * from view) and generating from the view works okay.

Any ideas on where to look?

thx

 

jack

 

Generating project "C:\epm\GeneratedFiles\ePM.csp" outputs...
Compiling template "C:\framework\CodeGenTemplates\CodeSmith\CSLA35\CSharp\EditableRoot.cst"...
Template compilation succeeded. (10 ms)
Rendering output 'DataCollection.cs'...
Error: ePM.csp(0,0) Parameter 'DATA_ENTRY_ID': No size set for variable length data type: String.
Stack Trace:
   at System.Data.OracleClient.OracleParameterBinding.PrepareForBind(OracleConnection connection, Int32& offset)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
   at SchemaExplorer.OracleSchemaProvider.GetCommandResultSchemas(String connectionString, CommandSchema command)
   at SchemaExplorer.CommandSchema.get_CommandResults()
   at CodeSmith.Csla.TemplateBase.ObjectInfo.LoadProperties(CommandSchema command, Int32 resultSetIndex, StringCollection uniqueColumns, StringCollection filterColumns)
   at CodeSmith.Csla.TemplateBase.ObjectInfo.LoadFromSchema(CodeTemplate template)
   at CodeSmith.Csla.TemplateBase.ObjectInfo..ctor(CodeTemplate template)
   at _CodeSmith.EditableRoot_cst.__RenderMethod1(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, Boolean overwrite)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, Boolean overwrite)
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject csp)
Unable to render output DataCollection.cs, skipping...
Done rendering outputs: 0 succeeded, 1 failed, 0 skipped (204ms).

cliffordru replied on Thursday, November 06, 2008

Hi Jack, can you check to see if the column in question has an empty string in it?  If so, can you try updating to eliminate the empty strings?  This may be related to the Oracle Client having issues with empty strings on variable length columns.

Jack replied on Tuesday, November 11, 2008

That column can be null - I actually had engaged CodeSmith support with the issue and they found a bug or two in the Oracle schemaprovider.  The support person said they had a new build and would release it yesterday/today.  I haven't seen it yet but we'll see. 

I'll give that a try first and if that doens't cure the issue I'll try putting data in those columns - however that is only really going to help me to pass it along to CodeSmith as I can't obviously keep putting bogus data in the table just to run the CodeGen.  I also have a bunch of triggeres and RI on that table related to all the similar nullable string columns.

Thanks for you input and I'll update this when I get a update from CodeSmith

Jack

Copyright (c) Marimer LLC