Knowledgebase
[QODBC-Online] Sample Code for VB.NET with QODBC Online
Posted by Rajendra Dewani (QODBC Support) on 10 August 2015 02:12 PM

Sample Code for VB.NET with QODBC Online

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 Online Data")
cnQODBC.Open()
daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT ListID, FullName, CompanyName FROM Customer", cnQODBC)
dsQODBC = New System.Data.DataSet

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

 


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

(0 vote(s))
Helpful
Not helpful

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