Sign in to follow this  
Nisus

While (Ors.readdata.read()) - Error

Recommended Posts

Hi,

 

I am trying to see the example given form fusionchart for asp.net c#.I have changed the connection settings in to SQL

server everything seems ok but having a problem with data reader.Please see the attached file.

 

Here is the code.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataConnection;
using InfoSoftGlobal;
using System.Data.SqlClient;

public partial class User_Chart : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
   	// Generate chart in Literal Control
   	FCLiteral.Text = CreateChart();
}

public string CreateChart()
{
   	DbConn oRs;
   	string SqlQuery;
   	string strXML;

   	//Generate the graph element
   	strXML = "<graph caption='Factory Output report' subCaption='By Quantity' decimalPrecision='0' showNames='1' numberSuffix=' Units' pieSliceDepth='30' formatNumberScale='0'>";

   	SqlQuery = "select * from Factory_Master";
   	oRs = new DbConn(SqlQuery);

   	//Iterate through each factory
   	while (oRs.ReadData.Read())
   	{

       	//Generate <set name='..' value='..' />
       	strXML += "<set name='" + oRs.ReadData["MonthShortName"].ToString() + "' value='" + oRs.ReadData["uUnits"].ToString() + "' />";

   	}

   	oRs.ReadData.Close();

   	//Finally, close <graph> element
   	strXML += "</graph>";

   	//Create the chart - Pie 3D Chart with data from strXML
   	return FusionCharts.RenderChart("../FusionCharts/FCF_Column3D.swf", "", strXML, "FactorySum", "600", "350", false, false);

}
}

 

Waiting for your reply

Thanks

post-10689-011901900 1294227994_thumb.jpg

Share this post


Link to post
Share on other sites

Hi,

 

It seems that the "Factory_Master" table does not exist in the database from where you are retrieving the data to render the chart.

 

Could you please recheck with this?

 

Hope this helps. :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this