What is the linq equivalent of a SQL clause like WHERE UserName LIKE 'fr_d'?
I’m working with a dataset in memory rather than a SQL database so I don’t think I can use something like where SqlMethods.Like(p.UserName, "Fr_d")
(Not that my installation of VS2008 is admitting that SqlMethods or even System.Data.Linq.SqlClient
exist at the moment, but thats a whole different problem!)
Like this:
(You may also want to call
ContainsorEndsWith)EDIT: In your case, you want
Alternatively, you can also put a regex inside the
Whereclause.If you do, make sure to create the
RegExobject outside theWherecall so that it doesn’t get parsed for each row.