Code Examples
  Home arrow Code Examples arrow Creating a Chart using Data from a Databas...
Iron Speed
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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 / 26
    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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    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

    - Handling Animations and Bitmaps Using GDI+ f...
    - Download a Web Page using the WebClient
    - Creating a Chart using Data from a Database ...
    - The Basics of Charting with the MS Chart Con...
    - Searching Body Text with textRange: Enter th...
    - Searching Body Text with textRange: Building...
    - Searching Body Text with textRange, part 1: ...
    - First Steps in Programming
    - Programming in C
    - Quick Introduction to ASF,ASX, and Networkin...
    - SatView: Pointer Perfect, Part 2: Constructi...
    - SatView: Pointer Perfect, Part 1
    - Style Case Studies: Construction Unions
    - Creating an Engine for Games for Windows
    - Style Case Studies: Generic Callbacks

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway