Plotting from Database example
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Plotting from Database example Expand / Collapse
Author
Message
Posted 1/21/2008 10:21:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/1/2008 4:28:27 AM
Posts: 5, Visits: 18
Hi

I have been trying out the example (Plotting from a database) in the documentation, and i was able to connect to a local ACCESS database and the chart was successfully created, but when i try to connect to a remote SQL db it throws the following error.


Object reference not set to an instance of an object.
Source Error:

Line 34:
Line 35: //Iterate through each record
Line 36: while (oRs.ReadData.Read()){
Line 37: //Generate
Line 38: xmlData.AppendFormat("",oRs.ReadData["FactoryName"].ToString(), oRs.ReadData["TotQ"].ToString() );


I think that it is not successfully connecting to the Database.
I changed the web.config file to this:

providerName="System.Data.SqlClient" />

and activated the SQL code in DBConn.cs.

I really need help as i have been stuck on this problem for days.

Thanks


Post #3991
Posted 1/22/2008 4:52:44 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 7:27:38 AM
Posts: 551, Visits: 1,782
hi,

yes its Sql Server Connection problem.. if you want to connect Sql Server with SqlConnection provider then please change <connectionStrings> with in web.config, Please Add

<add name="sqlServerConnection" providerName="System.Data.SqlClient" connectionString="uid=< user id >;pwd= < Pass word>;server=<remort sql server name>;database=<database name>"/>

also use SqlConnection, SqlDataReader,SqlCommand instead of OdbcConnection, OdbcDataReader, OdbcCommand in DBConn.cs

Arindam

Infosoft Global


Thanks,
Arindam

FusionCharts Team
www.fusioncharts.com

Post #4004
Posted 1/22/2008 2:35:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/1/2008 4:28:27 AM
Posts: 5, Visits: 18
Thank-you


Problem fixed and Pie Chart working perfectly!

Post #4012
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:19pm


Execution: 0.109.