MindFusion WinForms Programmer's Guide
Using VisualStudio 2005

Practical Tips: How To Connect MindFusion.Charting's Database Properties to a Database in VisualStudio 2005?

Create a database connection

  1. Right-click the Servers pane and choose Add Connection.
  2. Choose the data source and database names, test the connection and press OK.

Create a DataAdapter

  1. In design view, choose the appropriate data adapter control from the toolbox - OleDbDataAdapter, OdbcDataAdapter, and so on. You can add more database controls if you right-click the Toolbox pane and select Choose Items.
  2. Follow the steps of the DataAdapter wizard to choose the appropriate database tables and columns that you'll need.

Create a DataSet

  1. Right-click at the icon of the DataAdapter you have created in the previous steps.
  2. Choose Generate DataSet.

Bind MindFusion.Charting properties

  1. In design view, in the 'Data' properties group in the Properties' browser for MindFusion.Charting, first set DataSource to your DataSet object from the drop-down list.
  2. Set DataMember to the desired database table from the drop-down list.
  3. Search for the chart properties (ending with 'field(s)') and bind them to the respective columns from the drop-down list.

Read the data at run time

Add the following lines of code in your application, a good place is behind InitalizeComponent():

C#  Copy Code

myDataAdapter.Fill(myDataSet);
myChart.DataBind();
myChart.UpdateChart();

See Also

Using VisualStudio 2008