|
|
|
Forum 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
|
|
|
|
|
Supreme 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
|
|
|
|
|
Forum 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!
|
|
|
|