title: how to call another method in C# from another file
body: <p>I have tried looking through many sources, but I just do not understand what needs to be done as I am not a C# developer. The only reason I have been assigned this project is because the web services we need to connect to apparently is only compatible in C#. So I am just learning as I go trying to get this project done. And no one else in our dept. knows C#. 
  I am building a SSIS package, and have a "Script Task" using C#. The scriptMain.cs which the tool creates is this</p>
  
  <pre><code>using System;
  using System.Data;
  using Microsoft.SqlServer.Dts.Runtime;
  using System.Windows.Forms;
  using ST_3c3fd2f1b7404161b62ff2b81f12192c.ServiceClient;
  
  namespace ST_3c3fd2f1b7404161b62ff2b81f12192c.csproj
  {
  [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
  public partial class ScriptMain :     Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
  {
  
      public void MainScript()
      {
          // TODO: Add your code here
          Program.Main();//I AM TRYING TO MAKE THE CALL TO PROGRAM.cs file Main() method
          Dts.TaskResult = (int)ScriptResults.Success;
      }
  }
  }
  </code></pre>
  
  <p>I guess this ScriptMain.cs is the file that gets executed when I run the SSIS. So I am trying to make a call from scriptMain.cs (Program.Main()) from above to file Program.cs below:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using ST_3c3fd2f1b7404161b62ff2b81f12192c.ServiceClient;
  using ST_3c3fd2f1b7404161b62ff2b81f12192c.csproj;
  
  namespace ST_3c3fd2f1b7404161b62ff2b81f12192c
  {
  class Program
  {
      static void Main()//Trying to call this so that it can execute its   methods/processes
      {
          WebClient client = GetClient();
  
          // Example 1 - Select Changes
          SelectTicketChanges(client);
          SelectStepChanges(client);
      }
  </code></pre>
  
  <p>As you can see this Main() method calls other methods. I did not write this BTW, it was provided by the client who we are trying to connect to.</p>
  
  <p>Right now, Program.Main(), Main() has red error underneath saying
  "Program.Main() is inaccessible due to its protection level"</p>
  
  <p>If I change </p>
  
  <pre><code> static void Main()
  </code></pre>
  
  <p>to</p>
  
  <pre><code> public void Main()
  </code></pre>
  
  <p>than my ScriptMain.cs Program.Main() all gets Red Error underneath saying 
  "An Object reference is required for the non-static field, method, or property.."</p>
  
  <p>I just want it to call that other method, so that it can do its function. </p>
  
  <p>If you could be as little as technical as you can be that would be really great. As I have said I'm just learnin C# as I go through this project.</p>
  
  <p>Thanks!</p>