Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear reader,

I'm currently trying to access the results of a SAP Gateway ODATA service but one particular method doesn't seem to comply with .net result expectations. The code below is what I'm using and the result is that all the entries are filled with the values of the last entry. LINQPad shows two results; in the richtext view it gives me the correct values of all the entries and the Datagrids result resembles the problem I have in my code (multiple copies of last entry)

CRM_Open_Dagen.ZCRM_EVENTS01_SRV.ZCRM_EVENTS01_SRV ZCRM_EVENTS01_SRV =
    Data.ZCRM_EVENTS01_SRV.Get_ZCRM_EVENTS01_SRV();

DataServiceQuery<CRM_Open_Dagen.ZCRM_EVENTS01_SRV.SOptions> SOptions = ZCRM_EVENTS01_SRV.SOptionsSet;

List<CRM_Open_Dagen.ZCRM_EVENTS01_SRV.SOptions> ListSOptions =
    (from s in SOptions
     where s.Show == Category
     select s).ToList();

return ListSOptions;


Anyone an idea how:
1) I can check the syntax of the odata result?
2) How I can tackle this problem?

Best regards and thanks,
Rémy
Posted
Comments
MNamrata 9-May-14 3:00am    
You mean to say that you get old data?
LiQuick 9-May-14 3:04am    
No. I should get for example 10 different entries but I get 10 (correct amount of entries) entries but all entries are a duplicate of the last entry. When I access the oData service with Chrome I get the correct results.

1 solution

Found out what the problem is:
There was a KEY defined in the SAP Gateway datamodel, but the returned data didn't contain a key. Somehow the default key was an empty string for each entry, so with the adding of each entry all the data containing the specific key '' would be updated, hence the last entry updated all rows with the data of the last entry.

Duh....
 
Share this answer
 

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