-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 04 Jul 2003 4:40 pm, Marco Canini wrote:
> > Unhandled Exception: System.InvalidCastException: Cannot cast from source
> > type to destination type
> > in <0x0007a> 00 System.Data.SqlClient.SqlDataReader:GetInt32 (int)
> > in <0x00189> 00 Interesource.Publish.Client.ContentList:.ctor
> > (System.Data.IDataReader,bool)
> > in <0x00012> 00 Interesource.Publish.Client.ContentList:.ctor
> > (System.Data.IDataReader)
> > in <0x000a2> 00
> > Interesource.Publish.Client.ContentProvider:ListContentItems
> > (Interesource.Publish.Entities.ContentTypeKey)
> > in <0x0009e> 00 simpletest.SimpleTest:Main (string[])
>
> this could be a different type mapping between mono's SqlClient and
> .net's SqlClient
>
> Could you report the table definition (sql), the datacolumn definition,
> and the code that raises the exception.

Ok, it definitely looks like Mono being a little naughty but it's a simple 
fix.

The offending code is:

uniqueId = reader.GetInt32(reader.GetOrdinal("RealContentItemId"));


and the fix is:

uniqueId = reader.GetOrdinal("RealContentItemId");

It seems that GetOrdinal is returning an Int32 and we then try to convert to a 
(wait for it) Int32. Mono should just ignore this code but it doesn't. 
Actually, the programming team never should have written it like this, but 
hey, Mono should handle this kind of stupidity.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iQIVAwUBPwWvsfr1e7bH1pzBAQJK4Q/+NlxVCzx8zaE4iGOcRm46hMn1WDh3o13y
4JKlrV3V3ejspE3xBtdmE3s7MYTzbTzUeS39fUJycg+CcivGBA5ibkkPj7VR1nn7
8+ZZj1UHM6n4weK2A+1GK2iCQmooBy3HrYzWEkKY5nXDfJSkVLkaj0r0DhQjh756
5SWrRlN2sUIlD+raqRrTg4Mixxr1KUDtx7biJ2L3p7CzjwZqFGc3Q44rVNjX/yMq
NuWdalTEwzYIqvLkiW8VCGSE0C6KXFavmMNRetZ3PHZl+6R+iFbUOWylmpYg419l
3Br0E1nkdtODzS3DPqK/OWytqF8R9MOZ5uLOGMYEL2kBizbjzYkTWv7eb4WY6ftH
LeC4lZMZbp6E9jbUe4ucEj9q6lO8TT1plpm8diS1taDc6MJpg6TrzHagcMVm50bk
48T9vF7TtIyfbpVwXPr2ZfnTW+WHNWtB3HyZKu/fOsdLP00STSh2jzVpQgxOEsKc
sPbiUH4nlLAC8EtNuRNVcWyT4qjCt/mMbDYVCMVlJm2TlbWSfKKOto1f4c4JtQ/G
X1kFDdVzZoA/JPOY26GY4olx57NEFDsz0vmputVasoXNtxnba3/ufFUazIKa7Hy0
jw+75G4CLTO66Fh808Vd784gH1XRBfR6bfFJYJso6KYCkzTSdMuw0GtrCJsTF21+
DIt/h4YSu/o=
=Q+Z5
-----END PGP SIGNATURE-----
_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to