Reputation: 59
I have a table 'UserLogin' which contains the columns: id
and userid
. Suppose I want to show userid
as 'user' in Gridview then we write query in sql
select userid as user from UserLogin
But I am working with entity framework. How can we solve this problem in entity framework?
Upvotes: 3
Views: 1659
Reputation: 8104
Usually you specify different Header text for that column within your GridView control.
But you can achieve similar functionality in Entity framework by using
select new { user = UserLogin.userid, id = UserLogin.id };
Upvotes: 3