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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -