DataClassesDataContext dc = new DataClassesDataContext();
var summaryFieldDB = from b in dc.PropertyCompanies where (b.SummaryField.Contains(txtSearch)) select b;
Session["summaryField"] = summaryFieldDB;
now how can access to field summaryFiledDB???
if use this
System.Data.Linq.Table<PropertyCompany> result = (System.Data.Linq.Table<PropertyCompany>)Session["summaryField"];
This line when run program say error:Unable to cast object of type ‘System.Data.Linq.DataQuery1[PropertyCompany]' to type 'System.Data.Linq.Table1[PropertyCompany]
if i use Store Procedure Like FullSearch
Session["search"] = dc.FullSearch("anv", true, true, true, true, true, true, true, true, true, true, true);
System.Data.Linq.ISingleResult<FullSearchResult> b = (System.Data.Linq.ISingleResult<FullSearchResult>)Session["search"];
foreach(var item in b)
{
//work with fields
}
this work fine!!!
But I do not want to work with the Stored Procedure
I query isn’t a table. IMO, you should settle on something like a
List<T>here:and