Last post Oct 17, 2015 10:34 PM by Lannie
Oct 04, 2015 08:51 PM|sreekanth.jonna|LINK
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["Event Id"]).ToString();
Can someone please advice me..
Oct 15, 2015 04:02 AM|Zhi Lv - MSFT|LINK
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?
Oct 15, 2015 09:59 AM|Lannie|LINK
after you convert Excel value to string to INT64
apply NUMBER formatting to avoid the default scientific notation.
Oct 17, 2015 10:07 AM|sikha.sarma|LINK
Plz answer some body ... I have same Issue
Oct 17, 2015 10:34 PM|Lannie|LINK
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