.NET Connection String 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 QuickBooks Online connection strings, and how to construct and use them.

QuickBooks Online Connection Strings

The following code snippet illustrates how to dynamically create or connect to an existing QuickBooks Online account:

using Devart.Data.QuickBooks;
...
QuickBooksConnection conn = new QuickBooksConnection();
conn.ConnectionString = @"CompanyId=**********;RefreshToken=******************************;TokenServer=file://QuickBooksToken.txt";

Connection Properties

The following table provides an overview of the key parameters that can be used in QuickBooks Online connection strings.

Name Description
Client Id and Client Secret OAuth 2.0 credentials obtained when registering a client application at developer.intuit.com with the developer account.
Company Id A unique identifier for a QuickBooks company.
Refresh Token QuickBooks OAuth 2.0 refresh token.
Token Server The location for storing OAuth 2.0 refresh tokens between sessions. This can be a file on disk or a registry key.
License Key Your unique license identifier required for accessing QuickBooks Online.

Other Connection Properties

The following table provides an overview of the key parameters that can be used in QuickBooks Online connection strings.

Name Description
Connection Lifetime Specifies that the connection's creation time is checked against the current time when returned to the pool. The default value is 0, meaning the connection always returns to the pool.
Connect Timeout -or- Connection Timeout Determines the timeout period (in seconds) to wait for a server connection before aborting the attempt and raising an error. The default value is 15.
Default Command Timeout Specifies the timeout period (in seconds) to wait for has been previously opened execution before aborting the attempt and raising an error. A value of 0 indicates no limit.
Initialization Command Specifies a data source-specific command to be executed immediately upon establishing the connection.
Max Pool Size Specifies the maximum number of connections allowed in the pool. Setting the Max Pool Size value of ConnectionString can affect performance. The default value is 100.
Min Pool Size Determines the minimum number of connections allowed in the pool. The default value is 0.
Persist Security Info Specifies whether security-sensitive information, such as the password, is excluded from the connection details if the connection is currently open or has been previously opened.
Pooling Specifies whether the QuickBooksConnection object should be retrieved from an existing pool or created and added to the pool by default when pooling is set to true.
Proxy Host Specifies the host name or IP address of the proxy server.
Proxy Password Specifies the password for accessing the proxy server account.
Proxy Port Specifies the proxy server port number. The default value is 3128.
Proxy User Specifies the proxy server account name.
Run Once Command Specifies a command to be executed when the connection is opened for the first time, but is skipped when the connection is reused from the pool.
Readonly Determines whether the connection is read-only, allowing only SELECT statements.
UTC Dates Specifies whether all datetime values retrieved from the data source are returned in UTC or converted to local time. It also determines if date values provided by the application (for example, in SQL statements) are treated as UTC or local time. The default value is false.

Conclusion

QuickBooks Online connection strings are vital for linking applications to QuickBooks Online, which ensures seamless communication between your application and its back-end database engine. This article offers in-depth guidance on creating and configuring these connection strings and different implementation methods.

In this context, dotConnect for QuickBooks Online is an indispensable tool that simplifies these connections and enables you to develop high-performance applications on the QuickBooks Online platform. To fully explore what dotConnect for QuickBooks Online can do, download the free trial and test it against your specific workload!

dotConnect for QuickBooks Online

Access an advanced ORM-enabled data provider for QuickBooks Online to develop .NET applications that easily interact with QuickBooks Online data