In a C# 2008 linq statment that looks at a directory path below, I am having problem with the following code.
string[] excelFiles = Directory.GetFiles(strFullpath, "*.xlsx")
.Select(path => Path.GetFileName(path))
.ToArray();
If there are no records selected, the code is caught in a try catch-block.
How can I change the code listed above to check for records when no records are selected for the string[] excelFiles array?
Also if possible, how can I change the statment above to allow me to check for no records and/or if the string[] excelFiles array is not even created?
C# linq no data selected
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Oct 16, 2012, 12:22 PM EDT