posts - 88 , comments - 3 , trackbacks - 0

Connect to QuickBooks From LightSwitch Applications

The CData Data Providers for ADO.NET enable you to integrate disparate data sources into LightSwitch applications. In this demo, you will create a LightSwitch application that connects with QuickBooks Desktop and displays account data in an editable grid. Any changes will be immediately reflected in QuickBooks. The procedure outlined below can be used with any CData ADO.NET Data Providers.

Connect to QuickBooks

To connect to Desktop editions of QuickBooks, use the included Remote Connector application to connect to QuickBooks. You can use the Remote Connector to connect to local and remote instances of QuickBooks. The Remote Connector must be installed and running on the host QuickBooks machine before beginning this tutorial. See the help documentation for a guide to setting up the Remote Connector.

Follow the steps below to configure connection properties and import tables in the Data Source Configuration wizard.

  1. Open Visual Studio and create a new LightSwitch Project.
  2. In a new LightSwitch Project, click 'Attach to external Data Source'.
  3. In the wizard that appears, select Database. The Add Connection dialog is displayed.
  4. Click Change to select the [company_name] [service] Data Source.
  5. Enter the connection details for your QuickBooks machine. In this example, QuickBooks is hosted on a separate machine.

    Additionally, set the CacheLocation and CacheMetadata properties to improve performance. The performance gained from caching data is especially relevant in LightSwitch projects, as creating the entity model requires data about every table and column. Cache the metadata before connecting to QuickBooks so that LightSwitch can pull the table schemas from the cache instead of sending a query for every table.

  6. Select the tables and views you would like to add to the project.

Create a Screen

Follow the steps below to add an editable grid and associate it with QuickBooks tables.

  1. In Solution Explorer, right-click the Screens folder and click Add Screen.
  2. In the resulting wizard, select the Editable Grid screen template.
  3. In the Screen Data menu, select which table or view to associate with the screen. This example uses the Accounts table.
  4. Run the LightSwitch application. The screen will automatically execute and populate with data.

LightSwitch Sample Project

To help you with getting started using the QuickBooks Data Provider within Visual Studio LightSwitch, download the sample project. You will also need the QuickBooks ADO.NET Data Provider to make the connection. You can download a free trial from cdata.com.

Note: Before running the demo, you will need to change your connection details. Right-click on the QuickBooks Desktop Data Source and click Update Data Source. In the resulting wizard, click the Previous button and enter the connection details for your QuickBooks host.

Print | posted on Thursday, April 26, 2012 3:11 AM | Filed Under [ lightswitch quickbooks cdata ]

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: