Click here to Skip to main content
15,904,156 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
var users = from u in cr.PersonalDetails
                       where u.createdBy == cid
                       select u;
           foreach (var ex in users)
           {
               d = (Guid)ex.UserId;
           }
           var username = from ur in cr.aspnet_Users
                          where ur.UserId == d
                          select ur;


           grvCustomer.DataSource = username;
           grvCustomer.DataBind();
Posted
Updated 7-Apr-11 0:55am
v2
Comments
Eduard Keilholz 7-Apr-11 7:03am    
What is your question?
Sandeep Mewara 7-Apr-11 8:16am    
Unclear and incomplete question.

1 solution

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?
C#
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.
SQL
var userid = (from u in cr.PersonalDetails
                       where u.createdBy == cid
                       select u.UserId).FirstOrDefault;
 
Share this answer
 
v2
Comments
Sandeep Mewara 7-Apr-11 8:15am    
Looks like OP posted this comment to you but not sure:
var users = from u in cr.aspnet_Users
where cr.PersonalDetails.Any(e=>e.createdBy==u.UserId)
select u;



grvCustomer.DataSource = users;
grvCustomer.DataBind();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900