This question already has an answer here:
- The query results cannot be enumerated more than once 2 answers
I have applied linq to sql in my project and it's taking a lot of time so I made a search to make it speedy and i have searched and took a reference from here
And my .cs code is
public static Func<DataClassesDataContext, int, IQueryable<editor_j_inf>>
editordetail1 = CompiledQuery.Compile((DataClassesDataContext db, int a) =>
from p1 in db.editor_j_infs
where p1.ed_journal_id == a
orderby p1.editor_id descending
select p1); //Its my precompile process
public void editordetail()
{
DataClassesDataContext db = new DataClassesDataContext();
var rr = editordetail1(db,Convert.ToInt32(Server.HtmlEncode(Request.Cookies["j_id"].Value)));
if (rr.Count() != 0)
{
txt_jtitle.Text = rr.First().j_title;
txtissn_p.Text = rr.First().issn_p;
}
}
but the error is coming as