0

I am trying to add a row to a DataTable using the following code:

for (int i = 0; i < datesCount; i++
{
    // Populate payments table with existing data  
    DataRow newPaymentRow = PaymentsMadeDataTable.NewRow();
    newPaymentRow["Date"] = datesSplit[i];
    newPaymentRow["Description"] = descSplit[i];    
    newPaymentRow["Amount"] = Convert.ToDecimal(amountSplit[i]);
    // Add row to data table
    PaymentsMadeDataTable.Rows.Add(newPaymentRow);
}

I am receiving the following Error, "Column 'RowIdent' does not belong to table".

What could be causing this error?

samb90
  • 1,063
  • 4
  • 17
  • 35

0 Answers0