Skip to main content
Answer

CDF DataModel - Querying data using c# CogniteSdk

  • February 17, 2025
  • 4 replies
  • 112 views

Sharizan Mohd Redzuan
Seasoned
Forum|alt.badge.img+4

I am using CogniteSdk c# to query data model from CDF.

 

When I tried to execute it, it did not return row items. Instead it just returned below result:

What is the correct way to use the DataModel in C# CogniteSdk to return rows of data as per below?

 

Best answer by Einar Omang

It’s hard to say for sure. It may be a naming issue, you can see what the method returns if you parametrize it with something like `JsonElement` instead of `WellResponse`.

4 replies

  • Practitioner
  • February 17, 2025

The C# SDK is just a wrapper around the API. You will have to process the returned instances into the output shape you want yourself.


Sharizan Mohd Redzuan
Seasoned
Forum|alt.badge.img+4

Hi Einar,

The problem is the data is not returning and it showing null as per below example. How can i make sure it does return the data and not returning null?

 


  • Practitioner
  • Answer
  • February 17, 2025

It’s hard to say for sure. It may be a naming issue, you can see what the method returns if you parametrize it with something like `JsonElement` instead of `WellResponse`.


Sharizan Mohd Redzuan
Seasoned
Forum|alt.badge.img+4

Hi Einar,

Thanks for the tip. After replace with JsonElement, seems like there a few layer of parent before can reach the actual parameters as below. Thanks for the help.