.NET Connection Strings for
QuickBooks Online
QuickBooks Online connection strings contain the essential parameters to establish a reliable connection to QuickBooks Online, facilitating smooth communication between your application and the service. This guide will walk you through the key components of dotConnect for QuickBooks Online connection strings, and how to construct and use them.
QuickBooks online connection strings
The below code snippet is used to create a new connection or connect to an existing QuickBooks Online account dynamically. Make sure to replace the placeholders with your actual credentials.
using Devart.Data.Dynamics; ... string companyId = "**********"; string accessToken = "**********"; string LicenseKey = "**********"; string connectionString = $"CompanyId={companyId};AccessToken={accessToken};LicenseKey={LicenseKey};";
Basic connection properties
The table below lists the valid names for values within the QuickBooks Online connection strings.
Name | Description |
---|---|
Company Id | The string that uniquely identifies a QuickBooks company. |
Access Token | QuickBooks OAuth 2.0 access token. |
Client Id | The first part of the OAuth 2.0 credentials pair that is obtained when you register a client application at developer.intuit.com/myapps with the developer account. |
Client Secret | The second part of the OAuth 2.0 credentials pair that is obtained when you register a client application at developer.intuit.com/myapps with the developer account. |
License Key | Specifies the license key. |
Advanced connection properties
The table below provides the valid names for values used in QuickBooks Online connection strings.
Name | Description |
---|---|
Token Server | A file or registry key that stores refresh tokens between sessions and automatically refreshes expired access tokens. |
Refresh Token | OAuth 2.0 refresh token for QuickBooks that is used to obtain new access tokens. |
NormalizeDbNames | The property that performs the normalization of database names. |
Connection Timeout | Time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. The default value is 15. |
Default Command Timeout | Time (in seconds) to wait for execution of a command before terminating the attempt and generating an error. 0 indicates no limit. |
Failover Retries | The number of retries to execute a command if it fails because of the exception. It indicates that the reason for the failure may be temporary. |
Local SQL Engine | The engine enables local SQL processing, allowing more standard SELECT statement features. |
Readonly | Determines whether the connection is read-only (allows only SELECT statements). |
UserAgent | Sets the value of the User-agent HTTP header. |
UTC Dates | Indicates whether all datetime values retrieved from the data source are returned as UTC values or converted to local time. Also, it indicates whether date values specified on the application side (for example, in SQL statements) are considered UTC or local. The default value is false. |
Sandbox | Determines whether to connect to the sandbox environment in QuickBooks. |
Connection Lifetime | Compares the connection creation time with the current time when a connection is returned to the pool. The connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. The default value is 0 (connection always returns to the pool). |
Max Pool Size | The maximum number of connections allowed in the pool. The default value is 100. Note that setting the Max Pool Size value of the ConnectionString can affect performance. |
Min Pool Size | The minimum number of connections allowed in the pool. The default value is 0. |
Pooling | Retrieves the QuickBooksConnection object from the appropriate pool or creates it and adds it to the appropriate pool. The default value is true. |
Initialization Command | Specifies a data source-specific command that should be executed immediately after establishing the connection. |
Run Once Command | A command to execute when the connection is opened the first time. It is not executed when the connection is taken from the pool. |
Proxy Host | The hostname or IP address of the proxy server. |
Proxy Port | The port number of the proxy server. The default value is 3128. |
Proxy User | The proxy server account name. |
Proxy Password | The password for the proxy server account. |
Persist Security Info | Indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been open. |
Conclusion
QuickBooks Online is a popular platform and a data source for many business applications, especially those created with C# and .NET. As data connectivity is always one of the key factors for the application's functioning, it is essential to ensure proper connection to the data source and automate the processes. This article presents detailed guidelines on values used in connection strings for QuickBooks Online and offers a sample of the code used to create that connection.
Additionally, to simplify all tasks related to establishing a connection to the data source, fetching the data from it, and manipulating that data, we recommend using Devart's dotConnect solutions - the product line of powerful data providers built with ADO.NET technology that allows the application developers to connect to various data sources and handle data directly without any additional client libraries.
Refer to dotConnect for QuickBooks if you work with this data platform and connect to it flawlessly! A fully functional free trial is available for 30 days, so feel free to test it under the full workload!