AllowNull - Index was outside the bounds of the array Error

Dec 1, 2008 at 2:43 AM
Hello:

I've tried DBEntry & Firebird and DBE is a nice .net orm.

I've the next definition:

 

[

AllowNull]
public abstract int Nrodoc { get; set; }

 

When I run I get the next message:

Index was outside the bounds of the array

"  in Lephone.Data.DynamicObject.Set2ndArgForGetNullable(MemberHandler f, ILBuilder il)\r\n   en Lephone.Data.DynamicObject.<>c__DisplayClass4.<OverrideLoadSimpleValuesByIndex>b__3(ILBuilder il)\r\n   en Lephone.Data.Common.MemoryTypeBuilder.DefineMethodDirect(MethodAttributes flag, String MethodName, Type returnType, Type[] paramTypes, EmitCode emitCode)\r\n   en Lephone.Data.Common.MemoryTypeBuilder.OverrideMethodDirect(MethodAttributes flag, String MethodName, Type OriginType, Type returnType, Type[] paramTypes, EmitCode emitCode)\r\n   en Lephone.Data.DynamicObject.OverrideLoadSimpleValuesByIndex(MemoryTypeBuilder tb, Type srcType, MemberHandler[] SimpleFields)\r\n   en Lephone.Data.DynamicObject.GetDbObjectHandler(Type srcType, ObjectInfo oi)\r\n   en Lephone.Data.DynamicObject.CreateDbObjectHandler(Type srcType, ObjectInfo oi)\r\n   en Lephone.Data.Common.ObjectInfo.Init(Type t)\r\n   en Lephone.Util.FlyweightBase`2.GetInstance(TKey t)\r\n   en Lephone.Data.Common.ObjectInfo.GetInstance(Type DbObjectType)\r\n   en Lephone.Data.DynamicObject.NewObject[T](Object[] os)\r\n   en Lephone.Data.Definition.DbObjectModelBase`2.New()\r\n   en WindowsFormsApplication1.Start.Main() en C:\\Documents and Settings\\Mauricio\\Escritorio\\pimxsource_0.6.0\\Main\\WindowsFormsApplication1\\WindowsFormsApplication1\\Start.cs:línea 59\r\n   en System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   en System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   en System.Threading.ThreadHelper.ThreadStart()"

Regards
Coordinator
Dec 1, 2008 at 6:19 AM
For ValueType like int, long, DateTime etc, should use Nullable<T> to define like:

public abstract int? Nrodoc { get; set; }
Dec 1, 2008 at 10:26 AM
ok,
thanks