# Not able to use the method QuerySql on Elasticsearch.Net v. 7 and newer

**URL:** <https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237>\
**Category:** Elasticsearch\
**Created:** [July 12, 2019, 12:38pm UTC](https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237 "2019-07-12T12:38:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasch1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rasch1/32/51425_2.png) [@rasch1](https://discuss.elastic.co/u/rasch1)\
**Post date:** [July 12, 2019, 12:38pm UTC](https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237/1 "2019-07-12T12:38:24Z")

</div>

Hey,

Hopefully I have added the question in the right place:).

Currently I am using [Elasticsearch.Net](http://Elasticsearch.Net) v.6.8.0.

```
var sqlRequest = new QuerySqlRequest();
sqlRequest.Query = $@"select value from index";
var result = client.QuerySql(sqlRequest);

```

works well and as expected.

When upgrading to [Elasticsearch.Net](http://Elasticsearch.Net) v.7.0.1.

The method QuerySql no longer exist.

Anybody able to see what have replaced this or what i am doing wrong.

Not interested at current time to use DSL to receive data.

---

<div class="post-metadata">

**Author:** ![rasch1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rasch1/32/51425_2.png) [@rasch1](https://discuss.elastic.co/u/rasch1)\
**Post date:** [July 14, 2019, 1:04pm UTC](https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237/2 "2019-07-14T13:04:27Z")

</div>

Hey, answering my own question..

Dohh....

SQL has received its own namespace, so methods are moved into the namespace.  
Updated code:

> var sqlRequest = new QuerySqlRequest();  
> sqlRequest.Query = $@"select value from index";  
> var result = client.Sql.Query(sqlRequest);

Similarly, different methods have been moved to their own namespaces:

- Cat
- Cluster
- Graph
- Nodes

---

<div class="post-metadata">

**Author:** ![rasch1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rasch1/32/51425_2.png) [@rasch1](https://discuss.elastic.co/u/rasch1)\
**Post date:** [July 14, 2019, 1:07pm UTC](https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237/3 "2019-07-14T13:07:07Z")

</div>

Closed

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 11, 2019, 1:07pm UTC](https://discuss.elastic.co/t/not-able-to-use-the-method-querysql-on-elasticsearch-net-v-7-and-newer/190237/4 "2019-08-11T13:07:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
