title: Sql bulkcopy error - The given ColumnMapping does not match up with any column in the source or destination
body: <p>I am trying to sqlbulkcopy to my sql table. My source that is the datatable has three columns and destination table has four columns the first column being idendity column. The destination table generates the values when record is inserted to the database. I am gettting  "The given ColumnMapping does not match up with any column in the source or destination" at the following line of code. sqlBulkCopy.WriteToServer(dtExcelData); I dont understand what is the problem. </p>
  
  <p>The destination table datatypes are as follows</p>
  
  <p>Id (int),
  AccountNumber (varchar 9) ,
  Amount (decimal 11,2),
  Sedol (nvarchar 30)</p>
  
  <pre><code>XSSFWorkbook xssfwb;
              using (FileStream file = new FileStream(excelPath, FileMode.Open, FileAccess.Read))
              {
                  xssfwb = new XSSFWorkbook(file);
              }
  
  
              var sheet = xssfwb.GetSheetAt(0); // Change this to the worksheet you want to import.
              var rows = sheet.GetRowEnumerator();
              var dtExcelData = new DataTable();
              var linenumber = 0;
              DataRow dr;
  
  
  
              dtExcelData.Columns.AddRange(new DataColumn[3] { 
              new DataColumn("AccountNumber", typeof(string)),
              new DataColumn("Amount", typeof(decimal)),
              new DataColumn("Sedol",typeof(string)) });
  
  
  
              while (rows.MoveNext())
              {
                  IRow row = (XSSFRow)rows.Current;
                  linenumber++;
  
  
                  row.GetCell(4).SetCellType(CellType.Numeric);
  
                  if (row.GetCell(0) != null)
                  {
                      dr = dtExcelData.NewRow();
                      dr["AccountNumber"] = row.GetCell(1).ToString();
                      //dr["Amount"] = decimal.Parse(row.GetCell(4).ToString());
                      dr["Amount"] = (decimal)row.GetCell(4).NumericCellValue;
                          dr["Sedol"] = row.GetCell(11).ToString();
  
  
                      dtExcelData.Rows.Add(dr);
                  }
              }
  
              DealingContext.ExecuteCommand("TRUNCATE TABLE [dbDealing].[MESSAGING].[Rebate]");
  
  
  
              //Set the database table name
              //using (SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(DealingContext.Connection.ConnectionString,SqlBulkCopyOptions.KeepIdentity))
              using (SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(DealingContext.Connection.ConnectionString))
              {
                  sqlBulkCopy.DestinationTableName = "[dbDealing].[MESSAGING].[Rebate]";
  
  
                  //[OPTIONAL]: Map the Excel columns with that of the database table
                  sqlBulkCopy.ColumnMappings.Add("AccountNumber", "Owning Account ID");
                  sqlBulkCopy.ColumnMappings.Add("Amount", "Amount");
                  sqlBulkCopy.ColumnMappings.Add("Sedol", "Related Asset Identifier value");
                  sqlBulkCopy.WriteToServer(dtExcelData);
  
              }
  </code></pre>