Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace ARIMA_simulator
{
    class modelClass
    {
        private double random_normal() 
        {
            // this statement causes the error
            Chart a_chart;
            //
            double rand;
            a_chart = new Chart();
            rand = random_generator.NextDouble();
            rand = pStd
               * a_chart.DataManipulator.Statistics.InverseNormalDistribution(rand);
            a_chart = null;
            return rand;
        }
    }
}


What I have tried:

1) I compared the code to another program which uses the same references and it works.
2) I searched Google for the error. I checked about 10 references and they were all gibberish.
Posted
Updated 24-Feb-16 17:34pm
v2
Comments
Garth J Lancaster 24-Feb-16 19:54pm    
can you please clarify what you mean by

"I compared *the code* to another program which uses the same references and it works."

do you mean you just compared the using statements, vis :-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

or did you actually check the 'References' section of Project Explorer and compare that to the References section of 'something that worked' ..
Fred Andres 25-Feb-16 10:29am    
I meant that I compared the references and the using to make sure they were the same. I wasn't looking very carefully because I missed the fact that on the current project I did not include the System.Windows.Forms reference as you can see from my response below. Thanks for your time.
[no name] 24-Feb-16 23:33pm    
Issue is mostly with referencing with the dll. Is that dll(System.Windows.Forms) referenced in your current project?
Fred Andres 25-Feb-16 10:20am    
Thanks. When I added the reference System.Windows.Forms, it worked. Can't believe I missed that.
Richard MacCutchan 25-Feb-16 4:28am    
Add the charting assembly to the References section of your project.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900