![]() |
VOOZH | about |
DataBinding facilitates two-way interaction with data through UI controls. Using the CData ADO.NET Provider for Act CRM streamlines the process of binding Act CRM data to Windows Forms and Web controls within Visual Studio. In this article, we will demonstrate using wizards to establish a binding between Act CRM data and a chart that dynamically updates. Additionally, the code walk-through section will guide you through the creation of a chart using just 10 lines of code.
DataBinding to a Chart consists of three steps: Instantiate the control, configure the data source, and databind.
To create a chart control and establish a connection to Act CRM, follow the steps outlined below using the Data Source Configuration Wizard. Within the wizard, you'll have the option to choose the specific Act CRM entities you wish to bind to.
In the Add Connection dialog, click Change to select the CData Act CRM Data Source.
Below is a typical connection string:
URL=https://myActCRMserver.com;User=myUser;Password=myPassword;ActDatabase=MyDB;
The and properties, under the Authentication section, must be set to valid Act! user credentials. In addition to the authentication values, see the following:
Connecting to Act! Premium
In addition to the authentication values, the to Act! is also required; for example https://eup1-iis-04.eu.hosted.act.com/.
Additionally, you must specify the you will connect to. This is found by going to the About Act! Premium menu of your account, at the top right of the page, in the ? menu. Use the Database Name in the window that appears.
Connecting to Act! Premium Cloud
To connect to your Act! Premium Cloud account, you also need to specify the property. This property is found in the URL address of the Cloud account; for example https://eup1-iis-04.eu.hosted.act.com/ActCloudName/.
Note that retrieving ActCRM metadata can be expensive. It is advised that you set the property to store the metadata locally.
When you configure the connection, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.
๐ Connection properties for the selected data source in the Add Connection dialog. (Salesforce is shown.)After adding the data source and selecting database objects, you can bind the objects to the chart. This example assigns the x-axis to ActivityDisplayName and the y-axis to Subject.
The chart is now databound to the Act CRM data. Run the chart to display the current data.
๐ The chart, filled with data at run time.
DataBinding to Act CRM data requires only a few lines of code and can be completed in three easy steps.
Below is the complete code:
ActCRMConnection conn = new ActCRMConnection("URL=https://myActCRMserver.com;User=myUser;Password=myPassword;ActDatabase=MyDB;");
ActCRMCommand comm = new ActCRMCommand("SELECT ActivityDisplayName, Subject FROM Activities", conn);
ActCRMDataAdapter da = new ActCRMDataAdapter(comm);
DataSet dataset = new DataSet();
da.Fill(dataset);
chart1.DataSource = dataset;
chart1.Series[0].XValueMember = "ActivityDisplayName";
chart1.Series[0].YValueMembers = "Subject";
// Insert code for additional chart formatting here.
chart1.DataBind();
Download a free trial of the Act CRM Data Provider to get started:
Download NowLearn more:
๐ Act CRM IconRapidly create and deploy powerful .NET applications that integrate with Act CRM data including Companies, Contact, Groups, Opportunities, and more!