namespace trycatchtest { class Program { static void Main(string[] args) { tryTest t = new tryTest(1); } } public class tryTest { public tryTest(int a) { try { string filePath = @"D:\FTP Root\BUS_01_Argese\CDR\Template1\1Row.csv"; var orders = System.IO.File.ReadAllLines(filePath).Skip(1); var query = from line in orders.AsParallel() select new { CallingNumber = GetCDRColumn() }; var col = query.ToList(); } catch (Exception ex) { string s = ex.Message; } } private string GetCDRColumn() { try { throw new Exception("My error"); return string.Empty; } catch (Exception ex) { throw ex; } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)