![]() |
VOOZH | about |
DataBinding facilitates two-way interaction with data through UI controls. Using the CData ADO.NET Provider for HCL Domino streamlines the process of binding HCL Domino data to Windows Forms and Web controls within Visual Studio. In this article, we will demonstrate using wizards to establish a binding between HCL Domino 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 HCL Domino, follow the steps outlined below using the Data Source Configuration Wizard. Within the wizard, you'll have the option to choose the specific HCL Domino entities you wish to bind to.
In the Add Connection dialog, click Change to select the CData HCL Domino Data Source.
Below is a typical connection string:
Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;
To connect to Domino data, set the following properties:
Domino supports authenticating via login credentials or an Entra ID (formerly Azure AD) OAuth application:
To authenticate with login credentials, set the following properties:
The driver uses the login credentials to automatically perform an OAuth token exchange.
This authentication method uses Entra ID (formerly Azure AD) as an IdP to obtain a JWT token. You need to create a custom OAuth application in Entra ID (formerly Azure AD) and configure it as an IdP. To do so, follow the instructions in the Help documentation. Then set the following properties:
The tenant ID is the same as the directory ID shown in the Azure Portal's Entra ID (formerly Azure AD) > Properties page.
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 Name and the y-axis to Address.
The chart is now databound to the HCL Domino data. Run the chart to display the current data.
๐ The chart, filled with data at run time.
DataBinding to HCL Domino data requires only a few lines of code and can be completed in three easy steps.
Below is the complete code:
DominoConnection conn = new DominoConnection("Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;");
DominoCommand comm = new DominoCommand("SELECT Name, Address FROM ByName WHERE City = 'Miami'", conn);
DominoDataAdapter da = new DominoDataAdapter(comm);
DataSet dataset = new DataSet();
da.Fill(dataset);
chart1.DataSource = dataset;
chart1.Series[0].XValueMember = "Name";
chart1.Series[0].YValueMembers = "Address";
// Insert code for additional chart formatting here.
chart1.DataBind();
Download a free trial of the HCL Domino Data Provider to get started:
Download NowLearn more:
๐ HCL Domino IconRapidly create and deploy powerful .NET applications that integrate with HCL Domino.