public PlaceItem editPlace(int id, PlaceItem place)
{
sqlConnection = null;
sqlConnection = TimeTableDatabase.getConnection();
try
{
using (sqlConnection)
{
string SQL = "UPDATE [foodplace] SET [name]='" + place.PlaceName + "'" +
" WHERE [foodplaceid] ='" + id.ToString() + "';";
sqlConnection.Open();
SqlCommand myCommand = new SqlCommand(SQL, sqlConnection);
myCommand.ExecuteNonQuery();
sqlConnection.Close();
sqlConnection = null;
return place;
}
}
catch (System.Exception)
{
return null;
}
}