I have a project that gets data from the database. I made some modifications to the database fields in the model and now I am getting the error
The 'XXX' property on 'YYY' could not be set to a 'Guid' value. You must set this property to a non-null value of type 'String'.
XXX is the key of the class and is defined in the model as
public string XXX {get; set;}
The data type of this field in my database is uniqueidentifier.
What is the "equivalence" of this data type in mvc3?
EDIT
I tried changing the datatype of XXX to
public Guid XXX {get; set;}
but I got the error
The 'UnallocatedId' property on 'YYY' could not be set to a 'Guid' value. You must set this property to a non-null value of type 'String'.
System.Guid
is the equivalent foruniqueidentifier
. I think there is no casting needed. you can check this link – Karthik Chintala