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++;
}
Loading
Jignesh TrivediPosted Aug 20, 2013, 11:20 PM
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.
Virgil BevansPosted Aug 21, 2013, 9:58 AM
VulpesPosted Aug 20, 2013, 6:17 PM