OZ

Members
  • Content count

    3
  • Joined

  • Last visited

About OZ

  • Rank
    Forum Newbie
  1. Problem with Nulls

    Thanks for that it worked fine. Really appreciate you assistance
  2. Problem with Nulls

    Code is below.It works fine except when there are nulls, we then get the dreaded Object reference not set to an instance of an object. ///THIS IS THE CODE public string GetManagementControls() { StringBuilder xmlData = new StringBuilder(); //Generate the chart element xmlData.Append( "<chart caption='' subCaption='RISK SCORES ' pieSliceDepth='30' showBorder='0'useRoundEdges = '1' formatNumberScale='0' connectNullData='0' numberSuffix=''>"); string factoryQuery = "SELECT AVG(CAST(SQone.SQoneScore2 AS INT)) as TotQ FROM SQone "; DbConn oRs = new DbConn(factoryQuery); //Iterate through each record while (oRs.ReadData.Read()){ String LableActivity = " ";LableActivity = " Documentation";xmlData.AppendFormat( "<set label='{0}' value='{1}' />", LableActivity, oRs.ReadData["TotQ"].ToString()); //xmlData.AppendFormat("<set label='{0}' value='{1}' />", (oRs.ReadData["LocationName"].ToString()), oRs.ReadData["ImpairScore"].ToString()); //xmlData.AppendFormat("<set label='{0}' value='{1}' />", oRs.ReadData["Complete"].ToString(), oRs.ReadData["TotQ"].ToString());} oRs.ReadData.Close(); //Close chart elementxmlData.Append( "</chart>"); //Create the chart - Pie 3D Chart with data from xmlData return FusionCharts.RenderChart("../FusionCharts/Bar2D.swf?noCache=2", "", xmlData.ToString(), "FactorySum2", "600", "300", false, false);}
  3. Problem with Nulls

    I have Nulls in my database. How do convert Null to say 0