Knowledgebase: Microsoft Products
[QODBC-Desktop] Sample Code for VB.NET with QODBC
Posted by brad waddell on 12 March 2009 05:21 PM

Sample Code for VB.NET with QODBC

Sample Code of VB.NET to Create DataSet

Note: The following code is the minimal code required to create a DataSet from the SQL statement and attaches the dataset to a DataGrid.

Dim cnQODBC As System.Data.Odbc.OdbcConnection
Dim daQODBC As System.Data.Odbc.OdbcDataAdapter
Dim dsQODBC As System.Data.DataSet

cnQODBC = New System.Data.Odbc.OdbcConnection("DSN=QuickBooks Data")
daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT ListID, FullName, CompanyName FROM Customer", cnQODBC)
dsQODBC = New System.Data.DataSet

dgDataGrid.DataSource = dsQODBC
dgDataGrid.DataBind() 'May or may not be required depending on where you put this code.

Please click here for downloading sample VB.Net project.


If you are using a 64-bit system, then you can specify x86 as Target CPU in Visual Studio.

Change project properties | Advanced Compile Options... | Target CPU | x86

If you want to use as a 64-bit, then you need to use QRemote 64-bit DSN “QuickBooks Data 64-bit QRemote” in the connection string.

QODBC Edition Related

     The difference between the Desktop and the Server Edition is that for running Service based application Server Edition license is required. The service-based application is active in the Server Edition which allows applications that call through a Windows Service (such as IIS, ColdFusion. MS SQL Server) to use QODBC and QuickBooks. So QODBC Server Edition should be chosen when using .NET.

     See also: for more about the differences between the Desktop and Server Edition.


IE Hanging Problem

     Sometimes one could get the problem that when trying to open the QODBC connection but the IE hangs. To resolve this use QRemote DSN "QuickBooks Data QRemote" instead of "QuickBooks Data" DSN See: How to use QRemote for more.


Please click here for How to build QuickBooks IIS Web application using QODBC Driver and Microsoft ASP.NET (Video)

Please click here for Sample code for ASP C# QODBC connection


Keywords: sample .net, sample, .net, Dot Net, C#,C#.Net ,VB.Net


(167 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please complete the captcha below (we use this to prevent automated submissions).