What are you trying? It seems like you'll get a single row in your gridview.
I can't understand your question, but
Why this?
var users = from u in cr.PersonalDetails
where u.createdBy == cid
select u;
foreach (var ex in users)
{
d = (Guid)ex.UserId;
}
You can get userid with this.
var userid = (from u in cr.PersonalDetails
where u.createdBy == cid
select u.UserId).FirstOrDefault;