Is the tblPersoon
implementing IEnumerable<T>
? You may need to do it using:
var query = (from p in tblPersoon.Cast<Person>() select p).Single();
This kind of error (Could not find an implementation of the query pattern) usually occurs when:
using System.Linq
)IEnumerable<T>
Edit:
Apart from fact you query type (tblPersoon
) instead of property tblPersoons
, you also need an context instance (class that defines tblPersoons
property), like this:
public tblPersoon GetPersoonByID(string id)
{
var context = new DataClasses1DataContext();
var query = context.tblPersoons.Where(p => p.id == id).Single();
// ...
You may need to add a using
statement to the file. The default Silverlight class template doesn't include it:
using System.Linq;
Make sure these references are included:
Then add the using statement
using System.Linq;
You must have forgotten to add a using statement to the file like this:
using System.Linq;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With