FormatException generating update script with Firebird

Thread is closed for posting
1 posts, 0 answers
  1. Alfred
    Alfred avatar
    1 posts
    Member since:
    May 2016

    Posted 09 Feb 2017 Link to this post

    Hello,

    I have been testing OpenAccess with Firebird 3.0.1 and creating and executing the script for a new database seems to work fine, but when i change my model and try to run:

    if (handler.DatabaseExists())
    {
        var script = handler.CreateUpdateDDLScript(null);
        if (script != null)
        {
            handler.ExecuteDDLScript(script);
        }
    }

     

    CreateUpdateDDLScript throws

    A first chance exception of type 'Telerik.OpenAccess.OpenAccessException' occurred in Telerik.OpenAccess.dll
    System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>CreateOpsDatabase.vshost.exe</AppDomain><Exception><ExceptionType>Telerik.OpenAccess.OpenAccessException, Telerik.OpenAccess, Version=2016.2.822.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342</ExceptionType><Message>System.FormatException: Input string was not in a correct format.</Message><StackTrace>   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e)
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase()
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.execute()
       at OpenAccessRuntime.OpenAccessSchemaAdapter.CreateUpdateDDLScript(SchemaUpdateProperties schemaUpdateProps)
       at OpenAccessRuntime.SchemaHandlerImpl.Telerik.OpenAccess.ISchemaHandler.CreateUpdateDDLScript(SchemaUpdateProperties props)
       at CreateOpsDatabase.Program.CreateUpdateSchema(OpsDatabaseContext ctx) in d:\TestContainer\OpsTestSystem\CreateOpsDatabase\Program.cs:line 47
       at CreateOpsDatabase.Program.Main(String[] args) in d:\TestContainer\OpsTestSystem\CreateOpsDatabase\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>Telerik.OpenAccess.OpenAccessException: System.FormatException: Input string was not in a correct format. ---&amp;gt; System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp;amp; number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s)
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.ObtainServerVersion()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.Execute()
       at OpenAccessRuntime.Relational.sql.SqlDriver.checkDDL(ICollection`1[] tables, Connection con, ControlParams controlParams, DDLAction actions)
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase()
       --- End of inner exception stack trace ---
       at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.tools.ant.DataObjectsTaskBase.throwBuildException(String str, Exception e)
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase()
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.execute()
       at OpenAccessRuntime.OpenAccessSchemaAdapter.CreateUpdateDDLScript(SchemaUpdateProperties schemaUpdateProps)
       at OpenAccessRuntime.SchemaHandlerImpl.Telerik.OpenAccess.ISchemaHandler.CreateUpdateDDLScript(SchemaUpdateProperties props)
       at CreateOpsDatabase.Program.CreateUpdateSchema(OpsDatabaseContext ctx) in d:\TestContainer\OpsTestSystem\CreateOpsDatabase\Program.cs:line 47
       at CreateOpsDatabase.Program.Main(String[] args) in d:\TestContainer\OpsTestSystem\CreateOpsDatabase\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><InnerException><ExceptionType>System.FormatException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Input string was not in a correct format.</Message><StackTrace>   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp;amp; number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s)
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.ObtainServerVersion()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.Execute()
       at OpenAccessRuntime.Relational.sql.SqlDriver.checkDDL(ICollection`1[] tables, Connection con, ControlParams controlParams, DDLAction actions)
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase()</StackTrace><ExceptionString>System.FormatException: Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp;amp; number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s, NumberStyles style, NumberFormatInfo info)
       at System.Int16.Parse(String s)
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.ObtainServerVersion()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.FirebirdSchemaReader.PrepareReader()
       at Telerik.OpenAccess.Runtime.Schema.DbSchemaReaderImp.Execute()
       at OpenAccessRuntime.Relational.sql.SqlDriver.checkDDL(ICollection`1[] tables, Connection con, ControlParams controlParams, DDLAction actions)
       at OpenAccessRuntime.DataObjects.tools.ant.SchemaMigrationTask.migrateDatabase()</ExceptionString></InnerException></Exception></TraceRecord>

    I also ran this code in another project using MS SQL Server and it seem to work fine there, so i guess this has something to do with me using Firebird.

     

    Thanks

    Alfred

Back to Top