Code Examples
  Home arrow Code Examples arrow Creating a Chart using Data from a Databas...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Creating a Chart using Data from a Database with MS Chart Control
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 33
    2006-09-05

    Table of Contents:
  • Creating a Chart using Data from a Database with MS Chart Control
  • Visual Basic Project to retrieve data
  • Connecting the chart to data
  • Assigning retrieved data to an array to display on the chart

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Chart using Data from a Database with MS Chart Control


    (Page 1 of 4 )

    We have seen earlier how to bring in a Microsoft Chart Control to a VB 6 project and configure some of its properties. The data displayed by the chart was hard-coded. In real life scenarios, the data will be generated by a program and the format of the output must be fed to the chart programmatically. Again this is one of the frequently asked popular questions on many forums: how do you use the MS Chart Control with data retrieved from a database?

    Introduction

    This tutorial shows you step-by-step how you may use the Microsoft Chart Control with data retrieved from a database, explaining the logic used. The data is retrieved by a suitable query run against a database on the localhost, XPHTEK, a SQL 2000 Server. The VB6 program and the SQL Server are both running on a Windows XP Professional machine.

    Retrieving data from a database

    Using ADO objects and a suitable connection string, the data will be retrieved from the database. The chart will be using the data from the SQL 2000 Server and therefore the SQL Server must be running.

    Database details

    The details of a simple table called 'Products' on the TestWiz database will be used. The next picture shows the database, 'TestWiz' on the left, the table in the tables list on the right and all the data it contains at the bottom. It has four rows of data on six columns.

    More Code Examples Articles
    More By Jayaram Krishnaswamy


       · Progress has a price to pay. Software getting outdated is going to remain for ever...
     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 9 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek