This is a migrated thread and some comments may be shown as answers.

[Solved] FormatException generating update script with Firebird

0 Answers 107 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alfred
Top achievements
Rank 1
Alfred asked on 09 Feb 2017, 04:45 PM

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

Tags
Data Access Free Edition
Asked by
Alfred
Top achievements
Rank 1
Share this question
or