CodeSmith Community
Your Code. Your Way. Faster!

Problem generating code with Codesmith 4 Beta and .netTiers

Latest post 11-14-2006 3:58 PM by Robert Hinojosa. 1 replies.
  • 10-27-2006 7:06 AM

    Problem generating code with Codesmith 4 Beta and .netTiers

    Hi everyone.

    I am using an Access 2003 database for a project I'm working on, and I was trying to generate code against it.

    When generating code, I get the following exception:

    -------------------------------------------------8<-------------------------------------------------
    Failed to compare two elements in the array.

    An error of type "InvalidOperationException" occured while attempting to execute this template.  To enable Just-In-Time debugging on this template set the "Debug" attribute to "True" in the "CodeTemplate" directive and add a "Debugger.Break()" statement in the template.

     System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at SchemaExplorer.TableKeySchema..ctor(DatabaseSchema database, String name, String[] foreignKeyMemberColumns, String foreignKeyTableOwner, String foreignKeyTable, String[] primaryKeyMemberColumns, String primaryKeyTableOwner, String primaryKeyTable)
       at SchemaExplorer.TableKeySchema..ctor(DatabaseSchema database, String name, String[] foreignKeyMemberColumns, String foreignKeyTable, String[] primaryKeyMemberColumns, String primaryKeyTable, ExtendedProperty[] extendedProperties)
       at SchemaExplorer.ADOXSchemaProvider.GetTableKeys(String connectionString, TableSchema table)
       at SchemaExplorer.TableSchema.get_Keys()
       at SchemaExplorer.TableSchema.get_ForeignKeys()
       at SchemaExplorer.TableSchema.a(TableSchema A_0, TableSchemaCollection A_1)
       at SchemaExplorer.TableDependancyComparer.Compare(Object x, Object y)
       at System.Array.GetPivotValue(IComparer comparer, Array keys, Int32 left, Int32 right)
       --- End of inner exception stack trace ---
       at System.Array.GetPivotValue(IComparer comparer, Array keys, Int32 left, Int32 right)
       at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
       at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
       at SchemaExplorer.TableSchemaCollection.Sort(IComparer comparer)
       at _CodeSmith.NetTiers_cst.Go()
       at _CodeSmith.NetTiers_cst.__RenderMethod1(TextWriter writer, Control control)
       at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
       at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
       at CodeSmith.Engine.CodeTemplate.RenderToString()
       at ej.s()
     -------------------------------------------------8<-------------------------------------------------

    The generation works if I don't create relationships between tables.

    Any ideas? 

    • Post Points: 35
  • 11-14-2006 3:58 PM In reply to

    Re: Problem generating code with Codesmith 4 Beta and .netTiers

    Hi,

     Unfortunately, netTiers does not support Access databases.  You can upgrade the Access Database to a SQL Express instance and it should work fine.


    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems