LINQ in Action roller

pass a variable into a linq query

I'm using: Visual Web Developer 2008 SQL Server Express 2008 C# codebehind Question: How do I pass a variable into a linq query? Situation: I'm trying to use the value of a Label inside of a GridView's row during it's "RowDataBound" event in a linq query. Code Snippet Label l1 = (Label)e.Row.Cells[1].FindControl("lbl"); string l2 = l1.ToString(); aDataContext db = new aDataContext(); var q = from a in db.tblOne where a.p1 == l2 select a.p2; Label1.Text = custLastName.ToString(); *l2 is the variable Read More...
Published Friday, October 31, 2008 2:34 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication