Time for action — creating a chart in ASP.NET using data from an SQL Server
1. Create a new file in your project and name it as
AnnualRevenues.aspx
.2. Include
FusionCharts.js
in this page by adding the code:<script type="text/javascript" src="Charts/FusionCharts.js"></script>
3. Add a literal control to the form in this file, so that the code is similar to the following:
<form id="form1" runat="server"> <asp:Literal ID="l1" runat="server"></asp:Literal> </form>
4. Open the code-behind file
AnnualRevenues.aspx.cs
and type in the following code:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Text; using InfoSoftGlobal; public partial class _AnnualRevenues : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string connStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename...