sql - c# List using where statement -


my application asp.net mvc using linq-to-sql. trying use following filter view.

i have added filter sql server view using:

where (dbo.client.recstatus null) or (dbo.client.recstatus = 0) 

it works when run in sql server management studio, still see entries in application.

i tried filter again in repository using:

list<vw_client_info> searchresult = new list<vw_client_info>().where(c=> c.recstatus != 1); 

recstatus smallint

i following error:

cannot implicitly convert type 'system.collections.generic.ienumerable' 'system.collections.generic.list'. explicit conversion exists (are missing cast?)

i appreciate assistance, in advance.

seems forget use tolist() method @ end. try this:

list<vw_client_info> searchresult =      new list<vw_client_info>().where(c=> c.recstatus != 1).tolist(); 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -