# AsDirectConnection Method

## Overloads

| [AsDirectConnection(String, String, X509Certificate2Collection, Boolean)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm#Qlik_Sense_JsonRpc_ILocation_AsDirectConnection_System_String_System_String_System_Security_Cryptography_X509Certificates_X509Certificate2Collection_System_Boolean_) |  | Defining the location as a direct connection to Qlik Sense using a specific user.<br>Connection will be made to port 4747 unless port is explicitly stated in location URI. |
| --- | --- | --- |
| [AsDirectConnection(String, String, X509Certificate2Collection, Int32, Boolean)](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm#Qlik_Sense_JsonRpc_ILocation_AsDirectConnection_System_String_System_String_System_Security_Cryptography_X509Certificates_X509Certificate2Collection_System_Int32_System_Boolean_) |  | Defining the location as a direct connection to Qlik Sense using a specific user. |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm)

## AsDirectConnection(String, String, X509Certificate2Collection, Boolean)

Defining the location as a direct connection to Qlik Sense using a specific user. Connection will be made to port 4747 unless port is explicitly stated in location URI.

### Declaration

```

          void AsDirectConnection(string userDirectory, string userId, X509Certificate2Collection certificateCollection, bool certificateValidation = true)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | userDirectory | User directory name |
| System.String | userId | User id |
| System.Security.Cryptography.X509Certificates.X509Certificate2Collection | certificateCollection | Collection of certificates to use when connecting |
| System.Boolean | certificateValidation | Indicates if invalid certificates should be ignored |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Sense.JsonRpc.ILocation.AsDirectConnection.htm)

## AsDirectConnection(String, String, X509Certificate2Collection, Int32, Boolean)

Defining the location as a direct connection to Qlik Sense using a specific user.

### Declaration

```

          void AsDirectConnection(string userDirectory, string userId, X509Certificate2Collection certificateCollection, int enginePort, bool certificateValidation = true)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | userDirectory | User directory name |
| System.String | userId | User id |
| System.Security.Cryptography.X509Certificates.X509Certificate2Collection | certificateCollection | Collection of certificates to use when connecting |
| System.Int32 | enginePort | The engine port to connect to. |
| System.Boolean | certificateValidation | Indicates if invalid certificates should be ignored |