CSLA .NET

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

CSLA Contrib - c# CodeSmith Templates

rated by 0 users
This post has 2 Replies | 1 Follower

Top 25 Contributor
Posts 286
Jack Posted: Mon, Nov 3 2008 3:29 PM

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

Top 500 Contributor
Posts 30
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
Top 25 Contributor
Posts 286
Jack replied on Tue, Nov 11 2008 8:49 AM

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

Page 1 of 1 (3 items) | RSS

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?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems