# How to execute raw SQL query in OpenSearch .Net Client

**URL:** <https://forum.opensearch.org/t/how-to-execute-raw-sql-query-in-opensearch-net-client/14829>\
**Category:** OpenSearch\
**Created:** [June 26, 2023, 3:00pm UTC](https://forum.opensearch.org/t/how-to-execute-raw-sql-query-in-opensearch-net-client/14829 "2023-06-26T15:00:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhsayan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/mhsayan/32/5693_2.png) [@mhsayan](https://forum.opensearch.org/u/mhsayan)\
**Post date:** [June 26, 2023, 3:00pm UTC](https://forum.opensearch.org/t/how-to-execute-raw-sql-query-in-opensearch-net-client/14829/1 "2023-06-26T15:00:19Z")

</div>

**Describe the issue** :  
I know that we can write DSL queries to search OpenSearch. But for some reason, I need to execute some raw SQL queries to get the result using the dotNet client. I can execute the raw query on DevTool in the OpenSearch Dashboard but I need to execute this from the .Net Client.

```auto
POST _plugins/_sql
{
  "query":"""SELECT * FROM bookmark_questions WHERE studentId = 5"""
}

```

[Note: This is just a sample query.]

In ElasticSearch, it’s possible. [Link](https://github.com/elastic/elasticsearch-net/issues/4000).

```auto
var q = new QuerySqlRequest()
{
   Query = req,
   Format = "json"
};
var resp = await _elasticClient.Sql.QueryAsync(q);

```

But in Opensearch, I couldn’t do that. **How can I execute this type of query?**
