Hello.
im trying to do get a bytea from my database like this:
Cover c = (Cover)session.Load (typeof(Cover),id);
and i get this output:
Quote:
Unhandled Exception: NHibernate.ADOException: could not load object ---> System.ArgumentException: An invalid argument was specified.
in [0x000a0] System.Array:CopyTo (System.Array array, Int32 index)
in [0x00027] (at /usr/ports/lang/mono/work/mono-1.1.7/mcs/class/Npgsql/Npgsql/NpgsqlDataReader.cs:504) Npgsql.NpgsqlDataReader:GetBytes (Int32 i, Int64 fieldOffset, System.Byte[] buffer, Int32 bufferoffset, Int32 length)
in <0x000c8> NHibernate.Type.BinaryType:Get (IDataReader rs, Int32 index)
in <0x000b7> NHibernate.Type.NullableType:NullSafeGet (IDataReader rs, System.String name)
etc.
how do i fix this?
here is Cover.cs:
Code:
public class Cover{
private byte[] pix;
private int id;
public Cover(){}
public byte[] Image{
get { return pix; }
set { pix = value; }
}
public int Id{
get {return id;}
set {id=value;}
}
}
thanks in advance!