I am new to the Entity Data framework and lambda query.
What I am trying to do is select a list of "contacts" and bind it to a grid or repeater.
However, although my query works in that it is able to retrieve contact records, I am unable to bind it to a repeater. When I do, it says "Object reference not set to an instance of an object".
Can someone please tell me what I am doing wrong?
IQueryable<Contact> contactsQuery = from c in cc.Contacts
from g in c.ContactGroups
where g.GroupNameID == 1
select c;
MyRepeater.DataSource = contactsQuery;
MyRepeater.DataBind();
The problem code is thrown and on the Datasource specification line:
MyRepeater.DataSource = contactsQuery;