Excel Data Converting to boolean RRS feed

  • Question

  • User-543160537 posted


    I am trying to load data from excel in LINQ DataTable, but the problem is EventId column in excel have more than 16 digits so the digits after 16 is treating as zeros.

    Data in excel is 112862898112862000

    Data in LINQ DataTable is : 1.12862898112862E+17

        DataTable SelectedRows = _datatable.AsEnumerable()
                                                        .Skip(startDataRow * endDataRow)
                                                        .Take(endDataRow - 1)
                        string EventId = string.Empty;
                        EventId = Convert.ToInt64(SelectedRows.Rows[0]["Event Id"]).ToString();

    Can someone please advice me..


    Sunday, October 4, 2015 8:51 PM

All replies

  • User-271186128 posted

    Hi Sree,

    Could you please explain more details about your problem? From the title, it seems that you want to convert data to Boolean, but in the content you are talking about the EventId column. Do you want to convert this column value to Boolean?

    Best regards,

    Thursday, October 15, 2015 4:02 AM
  • User269602965 posted

    after you convert Excel value to string to INT64

    apply NUMBER formatting to avoid the default scientific notation.

    Thursday, October 15, 2015 9:59 AM
  • User-2105033194 posted

    Plz answer some body ... I have same Issue

    Saturday, October 17, 2015 10:07 AM
  • User269602965 posted

    Convert the value as a String only avoiding converting to number INT64

    If it needs to be a number but not in default scientific notation (when numbers are long in length) then apply a FORMAT MASK for numbers to the conversion to INT64

    Saturday, October 17, 2015 10:34 PM