Im building a page that has to receive data from a database and displaying in a datagrid.
I use WCF RIA Services for this effect. However when I create my DomainContext (based on an Entity Model) it returns no data whereas the database contains plenty of it.
When I do this on sql server
select * from resposta
this is the result:
id data hora inquirido resposta1 resposta2
1 01/04/2013 11:27 912345678 Sim Não
2 01/04/2013 11:27 912345678 Sim Não
And when i do the same thing with Entity Framework
_CurrentDomainContext = new CallbacksDomainContext();
contactoDataGrid.ItemsSource = _CurrentDomainContext.contactos;
EntityQuery<contacto> query = _CurrentDomainContext.FilterContactosQuery(ani, contacto, hora, data, horaUpper, dataUpper, espera, opcao, queueDestino, cliente);
LoadOperation<contacto> loadOp = _CurrentDomainContext.Load(query, SearchFinished, null);
I get an empty datagrid.
My ria DomainData source is this:
<riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance my:resposta, CreateList=true}" Height="0"
LoadedData="respostaDomainDataSource_LoadedData" x:Name="respostaDomainDataSource"
QueryName="GetResponsesQuery" Width="0">
<riaControls:DomainDataSource.DomainContext >
<my:CallbacksDomainContext />
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
I must be missing something... Cause i'm new to silverlight and WCF RIA so this is probably a newbie's mistake. But I really can't find the cause for this :/