This question is locked. New answers and comments are not allowed.
Hi There,
I'm having trouble updating an object via an ASP.NET application. I've shortened the update method below for just updating a single field from a form. When I look at the value for the website.Text item, it is showing the "updated" value, however the changes are not being pushed to the database itself. Any help would be appreciated!
I'm having trouble updating an object via an ASP.NET application. I've shortened the update method below for just updating a single field from a form. When I look at the value for the website.Text item, it is showing the "updated" value, however the changes are not being pushed to the database itself. Any help would be appreciated!
01.
public
void
UpdateRestaurant(Guid guid)
02.
{
03.
using
(var dbContext =
new
WingFestEntitiesModel())
04.
{
05.
Restaurant restaurantToUpdate = (from r
in
dbContext.Restaurants1 where r.restaurantid == guid select r).First();
06.
restaurantToUpdate.website = website.Text;
07.
dbContext.SaveChanges();
08.
}
09.
Response.Redirect(
"restaurant.aspx?task=create"
);
10.
}
11.
}