Guest User

Guest User

  • Tech Writer
  • 271
  • 36.2k

update data on button click using linq in asp.net Entity Framework

Aug 13 2020 12:31 AM
I am trying to do update data...i use linq but cant take
 
FirstOrDefault()
 
First()
  1. protected void BtnUpdate_Click(object sender, EventArgs e)  
  2. {  
  3. using (var context = new WallpaperEntities7())  
  4. {  
  5. var CategoryName = TxtCategoryName.Text;  
  6. var Category = int.Parse(Request["Id"])  
  7. WallPaperCategory std = (from x in context.WallPaperCategries  
  8. where x.CategoryName == CategoryName  
  9. select x)

Answers (7)