title: I need to populate an array with the information from an Excel file
body: <p>The array is two dimensional. I'm able to read the information from the excel file. That much I have accomplished; but I can't figure out how to write the code to populate the array I have created. I cannot hard code the data because there is over two 2000 entries. I need the array so I can use the information from the excel file to plug into the formula in the rest of my program.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.Data.OleDb;
  using System.Runtime.InteropServices;
  using Excel = Microsoft.Office.Interop.Excel;
  using Microsoft.Office.Core;
  using System.Reflection;
  
  namespace WindowsFormsApplication4
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              Excel.Application xlApp;
              Excel.Workbook xlWorkBook;
              Excel.Worksheet xlWorkSheet;
              Excel.Range range;
  
              string str;
              int rCnt;
              int cCnt;
              int rw = 0;
              int cl = 0;
  
              xlApp = new Excel.Application();
              xlWorkBook = xlApp.Workbooks.Open(@"D:\data.csv", 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
              xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
  
              range = xlWorkSheet.UsedRange;
              rw = range.Rows.Count;
              cl = range.Columns.Count;
  
              decimal[,] coords = new decimal[2207,2];
  
  
              for (rCnt = 1; rCnt &lt;= rw; rCnt++)
              {
                  for (cCnt = 1; cCnt &lt;= cl; cCnt++)
                  {
  
                  }
              }
          }
      }
  }
  </code></pre>