I am trying to map the built in GuidValue to the uniqueidentifier primary key. However GuidValue is a 'string' and I guess that is where the problem lies.
Full error message:
AtomsFramework.RetrieveException : Invalid cast from System.String to System.Guid.
Inner Exception message : Invalid cast from System.String to System.Guid.
at AtomsFramework.PersistenceBroker.RetrieveObject(IPersistableObject& obj, Boolean useFind, Boolean useCache) in C:\Projects\sourceforge\dotnet 2.2\CPersistenceBroker.vb:line 200
at AtomsFramework.PersistentObject.Retrieve(PersistentObject& obj, Boolean useCache) in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 834
at AtomsFramework.PersistentObject.Retrieve(PersistentObject& obj) in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 855
at AtomsFramework.PersistentObject.Retrieve() in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 882
at AtomsDemo1.GeneralTest.FetchIndividual() in c:\inetpub\wwwroot\atomsdemo1\generaltest.cs:line 39
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have an SQL server handy at the moment to try it, but I've committed a few changes that *should* fix things.
Basically the changes are in the MSSQL provider where parameter values are set, and also in the PersistentObject and InjectedObject in SetAttributeValue.
You'll need to get the latest code from CVS (which is normally available about 5 hours after I commit changes)
Let me know how you go.
- Richard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How do I define my classes and mapping file so that I can map to tables that use a 'uniqueidentifier' (guid) as a Primary Key in MS SQL 2000?
The FAQ mentions how to use guids, but only shows how to map them to string fields in the database.
When I try it with uniqueidentifier columns I get 'Invalid cast from System.String to System.GUID' errors
I'll have to check this (I thought it was working for 2.2 RC1)
- Richard
ah, good point
I am on 2.0.1
I will try 2.2 RC1
Nope still doesn't work with 2.2.RC1
I am trying to map the built in GuidValue to the uniqueidentifier primary key. However GuidValue is a 'string' and I guess that is where the problem lies.
Full error message:
AtomsFramework.RetrieveException : Invalid cast from System.String to System.Guid.
Inner Exception message : Invalid cast from System.String to System.Guid.
at AtomsFramework.PersistenceBroker.RetrieveObject(IPersistableObject& obj, Boolean useFind, Boolean useCache) in C:\Projects\sourceforge\dotnet 2.2\CPersistenceBroker.vb:line 200
at AtomsFramework.PersistentObject.Retrieve(PersistentObject& obj, Boolean useCache) in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 834
at AtomsFramework.PersistentObject.Retrieve(PersistentObject& obj) in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 855
at AtomsFramework.PersistentObject.Retrieve() in C:\Projects\sourceforge\dotnet 2.2\CPersistentObject.vb:line 882
at AtomsDemo1.GeneralTest.FetchIndividual() in c:\inetpub\wwwroot\atomsdemo1\generaltest.cs:line 39
Hi Ian,
I don't have an SQL server handy at the moment to try it, but I've committed a few changes that *should* fix things.
Basically the changes are in the MSSQL provider where parameter values are set, and also in the PersistentObject and InjectedObject in SetAttributeValue.
You'll need to get the latest code from CVS (which is normally available about 5 hours after I commit changes)
Let me know how you go.
- Richard.