Hi!, when I try to run my app with Firebird Embedded I receive: "Specified cast is not valid."
Everything it's ok with Firebird Client/server.
The problem is with Decimal fields (NUMERIC(15,0) in the database)
CuentaEntity cuenta = new CuentaEntity(id);
adapter.FetchEntity(cuenta);
MessageBox.Show(cuenta.Numero.ToString()); // ok, string field with the correct value
MessageBox.Show(cuenta.Icono.ToString()); // ok, int field with the correct value
MessageBox.Show(cuenta.IdCuenta.ToString()); // decimal field (PK) -> exception "Specified cast is not valid."
Can you help me?
System.InvalidCastException was unhandled
Message="Specified cast is not valid."
Source="Microserver.Integrador.DAL"
StackTrace:
at Microserver.Integrador.DAL.EntityClasses.CuentaEntity.get_IdBanco() in P:\UnicajaIntegradorCuentas\Fuentes\Integrador\Microserver.Integrador.DAL\EntityClasses\CuentaEntity.cs:line 1023
at Microserver.Integrador.GUI.Helpers.CuentaHelper.TooltipCuenta(Decimal idCuenta) in P:\UnicajaIntegradorCuentas\Fuentes\Integrador\Integrador\Helpers\CuentaHelper.cs:line 29
at Microserver.Integrador.GUI.MainMenuForm.RefrescarTagCloud() in P:\UnicajaIntegradorCuentas\Fuentes\Integrador\Integrador\MainMenuForm.cs:line 51
at Microserver.Integrador.GUI.MainMenuForm..ctor() in P:\UnicajaIntegradorCuentas\Fuentes\Integrador\Integrador\MainMenuForm.cs:line 33
at Microserver.Integrador.GUI.Program.Main() in P:\UnicajaIntegradorCuentas\Fuentes\Integrador\Integrador\Program.cs:line 29
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Environment:
LLBLGen 2.6 - September 12th, 2008
C# - Adapter - .NET 2.0
Firebird 2.1