I am currently developing a WPF project in c#. The project takes a string (newMemoryRFID) which is defined when the page is initialised and uses it in a query. Like so
var query =
from c in MemoryData.Memory
where c.RFID == newMemoryRFID
select c;
this.DataContext = query;
this.View = ((CollectionView)(CollectionViewSource.GetDefaultView(this.DataContext)));
This produces an empty DataContext
However when I use test data which is the same as what newMemoryRFID would be the query i.e.
var query =
from c in MemoryData.Memory
where c.RFID == "0F02D76B05"
select c;
this.DataContext = query;
this.View = ((CollectionView)(CollectionViewSource.GetDefaultView(this.DataContext)));
The query gets the correct record. As you may be able to tell I'm not the best programmer so the simpler your answer the better. And thanks very much in advance
newMemoryRFID. Chances are there might be some white spaces or something in there.