Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
Connect to Visual Studio |
Author |
Message |
|
Posted : 2008-03-25 09:41:02 |
I have seen the other posts about issues with connecting to Visual Studio (i.e. make sure that the Run 2.1 ODBC compatability is not marked") etc. but I am still not sure how to be able to get the data to come into Visual Studio.
For the Data Connections, do I do the ".Net Framework Data Provider for ODBC?" The "Test Connection" works, and I see the tables, but I have been unable to query any of the information. Any help would be greatly appreciated.
Thanks, Kevin
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-03-26 13:02:47 |
You should be able to connect to the ODBC data source using the OdbcConnection class (see: http://msdn2.microsoft.com/en-us/library/system.data.odbc.odbcconnection.aspx).
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") 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 maynot be required depending on where you put this code. |
|
|
|
|