CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

CSLA Contrib - c# CodeSmith Templates

Last post 11-11-2008, 8:49 AM by Jack. 2 replies.
Sort Posts: Previous Next
  •  11-03-2008, 3:29 PM 27897

    • Jack is not online. Last active: 03 Jul 2009, 1:46 PM Jack
    • Top 25 Contributor
    • Joined on 10-30-2008
    • Calgary, AB Canada
    • Posts 172
    • Points 2,620

    CSLA Contrib - c# CodeSmith Templates

    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).

  •  11-06-2008, 8:09 AM 27990 in reply to 27897

    Re: CSLA Contrib - c# CodeSmith Templates

    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.
    Regards,

    Cliff
    www.graytechnology.com
  •  11-11-2008, 8:49 AM 28137 in reply to 27990

    • Jack is not online. Last active: 03 Jul 2009, 1:46 PM Jack
    • Top 25 Contributor
    • Joined on 10-30-2008
    • Calgary, AB Canada
    • Posts 172
    • Points 2,620

    Re: CSLA Contrib - c# CodeSmith Templates

    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

View as RSS news feed in XML

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems