TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
C# linq no data selected
Oct 16 2012 3:36 PM
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?
Reply
Answers (
1
)
C# file exists
A simple question of methods