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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -