You did not tell us the error message and the code is very sloppy. There is no indication where "name" or "Id" are set.
cmd.Parameters.AddWithValue("@fruitsname", name);
The year value is assigned to four different parameters.
cmd.Parameters.AddWithValue("@fruitsyear", year);
cmd.Parameters.AddWithValue("@quality", year);
cmd.Parameters.AddWithValue("@taste", year);
cmd.Parameters.AddWithValue("@sales", year);
I think you need to clean up your code and do some basic debugging before posting.