Program creates/adds to data table of songs from specified folder(s), obtaining initial data by parsing the file names. User can search any time for new entries, so program needs to check to see if song is already in the data file. Wrote the following linq query to check for this condition, but it never returns results. Can someone explain my folly?
//search for duplicate record and loop if found
var result =
from kSong in DtSongs.AsEnumerable()
where kSong["DiskID"].ToString() == song[3] && kSong["Title"].ToString() == song[1] && kSong["Artist"].ToString() == kSong[2]
select kSong;
foreach (var r in result)
{
count++;
}
Query not returning results
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 20, 2013, 7:20 PM EDT
I think nothing is worng in your Linq query expect text suggested by vulpes.
also check your song array has correct value and that check with correct value with your data table.
VulpesRank #55 · 29.2K reputationPosted Aug 20, 2013, 2:17 PM EDT
Virgil Bevans16 reputationPosted Aug 21, 2013, 5:58 AM EDT