Linq: fetch the record by checking the range of attributes

Below is the table schema which i will use to make u understand the phenomenon id bigint AmountUpTO decimal Fee decimal the code for fetching the admin fee according to to the range of the Amount Up to is below   BTRatesDataContext db = new BTRatesDataContext(); var adminFees = from a in db.AdminFees where a.AmountUpto [...]

getting id from QueryString and updating record by LINQ

getting id from QueryString and updating record by LINQ below is the code snippet to do that   BTRatesDataContext database = new BTRatesDataContext(); var policies = from q in database.Policies where q.id == Convert.ToInt32(Request.QueryString["id"]) select q; Policy p = policies.FirstOrDefault(); p.Status = "Canceled"; database.SubmitChanges();

Follow

Get every new post delivered to your Inbox.