# Tutorial for sending cypher queries from C#?

**URL:** <https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341>\
**Category:** .NET\
**Created:** [November 20, 2020, 8:18am UTC](https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341 "2020-11-20T08:18:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davideps](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/davideps/32/4441_2.png) [@davideps](https://community.neo4j.com/u/davideps)\
**Post date:** [November 20, 2020, 8:18am UTC](https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341/1 "2020-11-20T08:18:39Z")

</div>

I'm familiar with the ADO NET data provider for PostgreSQL (Npgsql). Using that driver, my C# code just sends SQL query strings and receives rows of results. I was surprised to find that there seems to be a lot of C# code necessary to issue a query to Neo4j, even though Cypher is concise. Could anyone suggest an up to date tutorial? I don't understand [https://neo4j.com/developer/dotnet/#\_the\_example\_project](https://neo4j.com/developer/dotnet/#_the_example_project). [https://github.com/DotNet4Neo4j/Neo4jClient/wiki/cypher](https://github.com/DotNet4Neo4j/Neo4jClient/wiki/cypher) looks a bit more manageable but is not a complete example.

---

<div class="post-metadata">

**Author:** ![charlotte.skardon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/charlotte.skardon/32/35185_2.png) [@charlotte.skardon](https://community.neo4j.com/u/charlotte.skardon)\
**Post date:** [November 20, 2020, 10:03am UTC](https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341/2 "2020-11-20T10:03:02Z")

</div>

Hey @davideps

I've not used [ADO.NET](http://ADO.NET) for a while now, but from memory, you have your `IDbConnection`, which you then use to create `DataTables` which are populated via queries with `IDbParameter` objects... The full flow (and naming obviously!) escapes me.

I've used both of the drivers you've picked there, and the reason there is more C# than with the ADO approach is largely down to things like the fundamental differences between a Graph Model and a Table based database.

I've been working on (and it's not complete yet) a project which demonstrates the official Driver vs. the Neo4jClient (and also an extension package for the official driver) here:

> **[GitHub - DotNet4Neo4j/MoviesMvcCore: An example ASP NET MVC Core project to...](https://github.com/DotNet4Neo4j/MoviesMvcCore)**
>
> An example ASP NET MVC Core project to access Neo4j using the official and community drivers - GitHub - DotNet4Neo4j/MoviesMvcCore: An example ASP NET MVC Core project to access Neo4j using the off...

It's to show how each connector works - all the actual queries being executed are the same. I've tried to document the code - and there is supposed to be a set of posts about it later on - but I haven't finished - in the sense I've not added tests yet.

I have written about testing the Official driver here: [https://xclave.co.uk/2020/10/23/testing-neo4j-driver-4-1-1-part-1/](https://xclave.co.uk/2020/10/23/testing-neo4j-driver-4-1-1-part-1/) and here: [https://xclave.co.uk/2020/11/02/testing-neo4j-driver-4-1-1-part-2-session-config/](https://xclave.co.uk/2020/11/02/testing-neo4j-driver-4-1-1-part-2-session-config/) if that helps?

All the best

Chris

---

<div class="post-metadata">

**Author:** ![davideps](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/davideps/32/4441_2.png) [@davideps](https://community.neo4j.com/u/davideps)\
**Post date:** [November 20, 2020, 11:44am UTC](https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341/3 "2020-11-20T11:44:26Z")

</div>

Chris, thank you for such a quick and detailed reply. I'm finding [MoviesMvcCore/MovieDriverController.cs at main · DotNet4Neo4j/MoviesMvcCore · GitHub](https://github.com/DotNet4Neo4j/MoviesMvcCore/blob/main/src/MoviesMvcCore/Controllers/MovieDriverController.cs) helpful. For someone new to Neo4j, is there a reason to choose one client over the other?

-david

---

<div class="post-metadata">

**Author:** ![charlotte.skardon](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/charlotte.skardon/32/35185_2.png) [@charlotte.skardon](https://community.neo4j.com/u/charlotte.skardon)\
**Post date:** [November 20, 2020, 1:51pm UTC](https://community.neo4j.com/t/tutorial-for-sending-cypher-queries-from-c/29341/4 "2020-11-20T13:51:35Z")

</div>

Generally, it's what you are most comfortable using - the official driver is _faster_ I would say, but requires more manual conversions etc -

The client uses the driver under the hoods for Bolt, but provides a (depending on you view) nicer way to get objects from it. The reason it's slower is down to the way it parses the objects back from the Driver.

You could use the client and you would still have access to the Driver if you wanted to use it:

```auto
((BoltGraphClient)client).Driver

```

Also - the `Neo4j.Driver.Extensions` package might make the Driver a bit easier to use.
