# How to add/enable header X-Trino-User for ADO.NET Provider for Presto

**URL:** <https://community.cdata.com/t/how-to-add-enable-header-x-trino-user-for-ado-net-provider-for-presto/531>\
**Category:** CData Drivers\
**Tags:** question, ado.net\
**Created:** [November 20, 2023, 8:16pm UTC](https://community.cdata.com/t/how-to-add-enable-header-x-trino-user-for-ado-net-provider-for-presto/531 "2023-11-20T20:16:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocketmaniac](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rocketmaniac](https://community.cdata.com/u/rocketmaniac)\
**Post date:** [November 20, 2023, 8:16pm UTC](https://community.cdata.com/t/how-to-add-enable-header-x-trino-user-for-ado-net-provider-for-presto/531/1 "2023-11-20T20:16:30Z")

</div>

I’m getting the following exception when trying to run the following code.

Is there a way to enable or set the HTTP Header&nbsp;X-Trino-User?

```csharp
PrestoConnection connection = new PrestoConnection($"Server={_configuration["TrinoServerIP"]};Port={_configuration["TrinoServerPort"]};");connection.Open();string sql = "SELECT * FROM hive.default.customer";PrestoCommand cmd = new PrestoCommand(sql, connection);PrestoDataReader rdr = cmd.ExecuteReader();while (rdr.Read()){ Console.WriteLine(String.Format("\t{0} --> \t\t{1}", rdr["Id"], rdr["Name"]));}

```

```auto
 PrestoAdo  Source: TrinoClientTests.cs line 91  Duration: 1.4 sec Message: Test method Juniper.Test.Trino.TrinoClientTests.PrestoAdo threw exception: System.Data.CData.Presto.PrestoException: [500] Could not execute the specified command: HTTP protocol error. 401 Basic authentication or X-Trino-User must be sent. ---> oro230j.TC: HTTP protocol error. 401 Basic authentication or X-Trino-User must be sent. Stack Trace: LdJ.j(Lax[] , Int32 , Int32 )LdJ.n()RUC.Nd()RUx.Nd()RTG.a(RUx )RTN.FJ()RTG.NS()KJ.U(SQLQuery , Int32 , RRq )KJ.d(IDataStatement , SQLQuery , QueryParameterCollection , Int32 , String , LeW )RUJ.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )RUG.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )LTx.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )ZW.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )yN.ExecuteQuery(IDataStatement , QueryParameterCollection , Int32 )RIe.FW()RIh.dd()SF.pg(QueryParameterCollection )PrestoCommand.ExecuteDataReader(CommandBehavior behavior)--- End of inner exception stack trace ---PrestoCommand.ExecuteDataReader(CommandBehavior behavior)PrestoCommand.ExecuteDbDataReader(CommandBehavior behavior)PrestoCommand.ExecuteReader()<PrestoAdo>d__5.MoveNext() line 104--- End of stack trace from previous location where exception was thrown ---ExceptionDispatchInfo.Throw()TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)ThreadOperations.ExecuteWithAbortSafety(Action action)

```

---

<div class="post-metadata">

**Author:** ![Ethem\_Q](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/ethem_q/32/1997_2.png) [@Ethem\_Q](https://community.cdata.com/u/Ethem_Q)\
**Post date:** [November 20, 2023, 10:48pm UTC](https://community.cdata.com/t/how-to-add-enable-header-x-trino-user-for-ado-net-provider-for-presto/531/2 "2023-11-20T22:48:17Z")

</div>

This is most likely happening due to you trying to connect to a Trino instance with the driver default settings configured to access a Presto database instead.

Since you are using Trino and not PrestoDB, it will be important to ensure you have adjusted the _'PrestoKind_’ property to ‘Trino’. Find more information on the property here:

> **[CData ADO.NET Provider for Presto - PrestoKind](https://cdn.cdata.com/help/ORJ/ado/RSBPresto_p_PrestoKind.htm)**
>
> CData ADO.NET Provider for Presto - RSBPresto - PrestoKind: Indicates whether the connected instance is Trino or not.

Setting the property should resolve the problem.&nbsp;In case you have any other questions or issues feel free to send those over at&nbsp;[support@cdata.com](mailto:support@cdata.com)&nbsp;or you can always submit a support case&nbsp;[here](https://www.cdata.com/support/submit.aspx).

---

<div class="post-metadata">

**Author:** ![rocketmaniac](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rocketmaniac](https://community.cdata.com/u/rocketmaniac)\
**Post date:** [November 21, 2023, 4:54pm UTC](https://community.cdata.com/t/how-to-add-enable-header-x-trino-user-for-ado-net-provider-for-presto/531/3 "2023-11-21T16:54:21Z")

</div>

Thanks @Ethem_Q …that worked!
