User-543160537 posted
Hi,
I am using LINQ to fetch data from excel and convert to XML, but i need to find one of the column value is string or number and then change the object value.
DataTable EventDetails = (from DataRow dr in SelectedRows.Rows
where dr["Event Id"].ToString() == item.ToString()
select dr).CopyToDataTable();
if (number)
{
Int64 evtId = Int64.Parse(EventDetails.Rows[0]["Event Id"].ToString(), NumberStyles.AllowExponent | NumberStyles.AllowDecimalPoint);
}
else
{
string evtId = EventDetails.Rows[0]["Event Id"].ToString();
}
Number will only number ex; 1234456777 and string may consist ex: abc, abc123, abc_123
Please advice
Thanks