locked
Error RRS feed

  • Question

  • User-1499457942 posted

    Hi

      I am importing Data from excel . ON some field it is giving below error

    The given value of type Double from the data source cannot be converted to type date of the specified target column

    I am mapping like below code

    objbulkInsert.ColumnMappings.Add(2, 2);

    Thanks

    Friday, July 27, 2018 5:30 AM

Answers

  • User-369506445 posted

    Hi

    • You provided an different value which cannot be converted to data type of the target.

    Fix

    • ENSURE provided value is valid for the destination type.
    • CREATE column by specifying the type to get the error before executing WriteToServer method.
    var dt = new DataTable();
    dt.Columns.Add("TheColumnInt", typeof(int));
    dt.Columns.Add("TheColumnString", typeof(string));



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 27, 2018 6:21 AM