title: In C#, how do I handle Oracle Float types? Receiving error "Arithmetic operation resulted in an overflow"
body: <p>I am using a generic approach to receiving a single row from any Oracle table and displaying it in a datagridview, using the code below.  But, if the table contains a column of float type and the value has a large number of decimal places, I get "Arithmetic operation resulted in an overflow" at the line: MyReader.GetValues(objCells);</p>
  
  <pre><code>            oCmd.CommandText = "OTCMIADM.OTCMI_GUI.GET_ROW";
              oCmd.CommandType = CommandType.StoredProcedure;
              oCmd.Parameters.Add("PI_TABLE_NAME", OracleDbType.Varchar2, 40).Value = cmbStagingTables.SelectedItem;
              oCmd.Parameters.Add("PI_ROWID", OracleDbType.Varchar2, 40).Value = txtRowID.Text;
              oCmd.Parameters.Add(new OracleParameter("PIO_CURSOR", OracleDbType.RefCursor)).Direction = ParameterDirection.Output;
  
              oCmd.ExecuteNonQuery();
  
              // clear the datagrid in preperation for loading
              dgvStagingTable.Columns.Clear();
              dgvStagingTable.Rows.Clear();
  
              using (OracleDataReader MyReader = oCmd.ExecuteReader())
              {
                  int ColumnCount = MyReader.FieldCount;
  
                  // add the column headers
                  DataGridViewColumn[] columns = new DataGridViewColumn[ColumnCount];
                  for (int i = 0; i &lt; columns.Length; ++i)
                  {
                      DataGridViewColumn column = new DataGridViewTextBoxColumn();
                      column.FillWeight = 1;
                      column.HeaderText = MyReader.GetName(i);
                      column.Name = MyReader.GetName(i);
                      columns[i] = column;
                  }
                  dgvStagingTable.Columns.AddRange(columns);
  
                  // get the data and add the row
                  while (MyReader.Read())
                  {
                      //get all row values into an array
                      object[] objCells = new object[ColumnCount];
                      MyReader.GetValues(objCells);
                      //add array as a row to grid
                      dgvStagingTable.Rows.Add(objCells);
                  }
              }
  </code></pre>
  
  <p>The stack trace shows:
     at Oracle.DataAccess.Types.DecimalConv.GetDecimal(IntPtr numCtx)
     at Oracle.DataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
     at Oracle.DataAccess.Client.OracleDataReader.GetValue(Int32 i)
     at Oracle.DataAccess.Client.OracleDataReader.GetValues(Object[] values)</p>
  
  <p>So I can see why it's causing an error (it's assuming a decimal conversion); but how do I get round this?</p>
  
  <p>I tried explicitly setting the type of the column before loading the data with:</p>
  
  <p>dgvStagingTable.Columns["TR_THROUGHPUT_TIME_NO"].ValueType = typeof(string);</p>
  
  <p>and several other typeofs, but nothing made any difference.</p>
  
  <p>Any help appreciated.</p>