title: how to convert arraylist to integer array in c#
body: <p>This is my code          </p>
  
  <pre><code>    con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/techsoft   /PP1.accdb;Persist Security Info=False");
          con.Open();
          cm = new OleDbCommand("select aa from ab", con);
          OleDbDataReader qq;
          qq = cm.ExecuteReader();
          ArrayList ss = new ArrayList();
  
          while (qq.Read())
          {
              object[] values = new object[qq.FieldCount];
              qq.GetValues(values);
              ss.Add(values);
  
  
  
          }
  </code></pre>
  
  <p>if i use this syntax  to convert</p>
  
  <pre><code>int[] i = (int[])ss.ToArray(System.Type.GetType("System.Int32"));
  </code></pre>
  
  <p>the following error occurs  " At least one element in the source array could not be cast down to the destination array type." </p>
  
  <p>plz suggest me a one solution or any other  alternative way</p>