$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Data Binding Chart to a DataBase in ASP.NET
Home > How to > Chart Binding Database Data

Data Binding Chart to a DataBase

Nowadays, the database data has been playing a very important role in almost all the companies and institutions. Thus, it is really useful if we can show the data from the basic into specified chart. And the KaxChart control allows users to bind chart to data objects from specified database. Apart the function for chart data binding with database, the KaxChart control also has the ability to finish the data binding chart to Array objects, data list and XML file. Here, we will set binding data from SQL database for example to show you the details of adding html chart data series.

Data Binding Chart to a DataBase in ASP.NET Application

In the following tutorial, we will guide you finish the project of data binding a web chart to database in ASP.NET web platform step and step. To bind chart to a database, you need first create a data source object and define the KaxChart data source to that created data source object. Then you can bind chart with objects from database using DataBind() method. Here we divide the whole chart data binding process into following five aspects.
  1. Click the KaxChart Smart Tag "Choose Data Source" | "<New Data Source>".
    binding database data to chart step1 in asp.net ajax
  2. From the "Choose a data source type" page of the wizard, pleaes select "Database" and click "OK".
    binding database data to chart step2 in asp.net ajax
  3. Select New Connection in the Configure Data Source page.
    binding database data to chart step3 in asp.net ajax
  4. In the Add Connection Page, click Data Source and select "Microsoft SQL Server Database File". After that, please locate the database file Northwind via the Browse button and click "ok". Then click "Next" and choose the button "Finish".
    binding database data to chart step4 in asp.net ajax
  5. Now you need to add following code to bind web chart to the data from above selected database, and then the data in the SQL will be insert to your web chart dynamicly. In order to let you run following C#.NET programming codes successfully in your web application, please make sure that your ASP.NET web project has installed NET Framework 3.5 or above versions and that you have installed all the necessary dlls from our ASP.NET AJAX SDK into your ASP.NET web application.

KaxChart1.Caption.Text = "SQL Database Binding";
KaxChart1.Diagram.AxisX.DataLabelsField = "Customer Order";
KaxChart1.SeriesSet[0].DataValueField= "Order Amount";
KaxChart1.DataSourceID = "sqlDataSource1";
KaxChart1.DataBind();

You can view the appearance of this guide on the free online demo of chart data binding with database. And you can add and bind database data source to all chart type Kettic asp.net chart supported, such as point chart, bar chart, line chart, pie chart stacked chart, stock chart.

Other Recommended Data Binding Applications

ASP.NET AJAX UI Controls