ComponentOne BubbleChart for ASP.NET Web Forms
Task-Based Help / Binding C1BubbleChart to an AccessDataSource
In This Topic
    Binding C1BubbleChart to an AccessDataSource
    In This Topic

    You can bind C1BubbleChart to a DataView by using the AccessDataSource to connect to the Microsoft Access DataBase file to the C1BubbleChart control and then using the Select command.

    1. Create a new Web Site.
    2. Copy the C1NWind.mdb database file from the App_Data folder from the ControlExplorer sample project to the App_Data folder in your project.
    3. Save and close the project then reopen it so you'll see that the C1Nwind.mdb file appears in your App_Data folder.
    4. Expand the Data node in the Visual Studio Toolbox and add the AccessDataSource component to your Web page using a drag-and-drop operation.
    5. Select Configure Data Source from AccessDataSource tasks menu.
    6. Click Browse to open the Select Microsoft Access Database dialog box and select the C1Nwind.mdb file to add it to the AccessSource1.DataFile property.
    7. Select Specify a custom SQL statement or stored procedure and enter the following in the SQL statement:

      To write SQL statement in Microsoft Access Database dialog box

      SelectCommand="select CategoryName, sum(ProductSales) as Sales, count(1) as CT from (SELECT DISTINCTROW
              Categories.CategoryName as CategoryName, Products.ProductName, Sum([Order Details Extended].ExtendedPrice) AS
              ProductSales
      FROM Categories INNER JOIN (Products INNER JOIN (Orders INNER JOIN [Order Details Extended] ON Orders.OrderID =
              [Order Details Extended].OrderID) ON Products.ProductID = [Order Details Extended].ProductID) ON
              Categories.CategoryID = Products.CategoryID
      WHERE (((Orders.OrderDate) Between #1/1/95# And #12/31/95#))
      GROUP BY Categories.CategoryID, Categories.CategoryName, Products.ProductName
      ORDER BY Products.ProductName) group by CategoryName;"
      
    8. Click Next and then click Finish.
      
    9. Add C1BubbleChart to your page. For more information see Getting Started with ASP.NET Web Forms Edition.
    10. In design-view select the C1BubbleChart and click on its smart tag to open its task menu.
    11. Select AccessDataSource1 from the Choose Data Source dropdownlistbox.
    12. In the C1BubbleChart properties window click the ellipsis button next to DataBinding. The C1BubbleChartBinding Collection Editor appears.
    13. Click Add to add a C1BubbleChartBinding member.
    14. Enter the values for the following C1BubbleChartBinding properties:
      • XField = CategoryName
      • YField = Sales
      • Y1Field = CT
    15. Expand the Axis->X->TextStyle node and set the Rotation property to -45.
    16. Run and save your project. Observe the following at run-time:

    See Also