SirReadAlot
asked on
Explicit construction of entity type 'DataAccessLayer.author' in query is not allowed.
Hi experts,
What is wrong with this query
I only want to select the named columns
thnaks
What is wrong with this query
I only want to select the named columns
thnaks
protected void Page_Load(object sender, EventArgs e)
{
PubsDataContext context = new PubsDataContext();
var author = from a in context.authors
select new author
{
au_id = a.au_id,
au_lname = a.au_lname,
au_fname= a.au_fname,
state = a.state
};
GridView1.DataSource = author;
GridView1.DataBind();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.