How to access Yes/No field of Sharepoint List using Linq?
===

I have one list in which there is field with the datatype of Yes/No. I am trying to retrieve data of that field but it is giving me following error :

> System.InvalidCastException: Specified cast is not valid. at Microsoft.SharePoint.Linq.SPQueryable.GetSPFieldValue[T](PropertyMap pm, DataContext dc, SPListItem item, Object entity, JoinPath joinPath) at lambda_method(ExecutionScope , SPListItem ) at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

My query is as follows:

    var query = (from san in db.San
                 select san.IsDeclaredCompleted).ToList();

So can anyone suggest me what i am doing wrong?

**NOTE: It is running perfectly on my local system but on server it is giving me error.**