title: ASP.Net C# GridView Update is not working
body: <p>I am having an issue but I am not getting any errors thrown. What's happening is that I have a stored procedure that is driving my update but I am unable to get the gridview to update.  </p>
  
  <p>I hit the <code>Update</code> link button but it doesn't actually update the record.  </p>
  
  <p>Here is my stored procedure:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[CompDev_Update](
  @CompID int,
  @NewDevCount nchar(10) = null,
  @DevelopmentName nvarchar(255) = null,
  @City nvarchar(255) = null,
  @State nvarchar(255) = null,
  @ZipCodeofNewDev nchar(10) = null,
  @ProjectStatus nvarchar(255) = null,
  @ShoppingCenter nvarchar(255) = null,
  @ProjectStartDate float = null,
  @ProjectDescription nvarchar(255) = null,
  @ProposedAnchorTenants nvarchar(255) = null,
  @GLA nchar(10) = null,
  @EstCompDate float = null,
  @Developer nvarchar(255) = null,
  @BusinessUnit nchar(10) = null,
  @BU nchar(10) = null,
  @CenterName nvarchar(255) = null,
  @MSA nvarchar(255) = null,
  @BrixmorMSARank nchar(10) = null,
  @Count nchar(10) = null,
  @Region nvarchar(255) = null,
  @DistancefromNewDev nchar(10) = null
  )
     AS
     BEGIN
  -- SET NOCOUNT ON added to prevent extra result sets from
  -- interfering with SELECT statements.
  SET NOCOUNT ON;
  
  -- Insert statements for procedure here
  UPDATE WestCompetition Set NewDevCount=@NewDevCount, DevelopmentName=@DevelopmentName,
      City=@City, [State]=@State, ZipCodeofNewDev=@ZipCodeofNewDev, ProjectStatus=@ProjectStatus,
      ShoppingCenter=@ShoppingCenter, ProjectStartDate=@ProjectStartDate, ProjectDescription=@ProjectDescription,
      ProposedAnchorTenants=@ProposedAnchorTenants, GLA=@GLA, EstCompDate=@EstCompDate,
      Developer=@Developer, BusinessUnit=@BusinessUnit, BU=@BU, CenterName=@CenterName,
      MSA=@MSA, BrixmorMSARank=@BrixmorMSARank, [Count]=@Count, Region=@Region,
      DistancefromNewDev=@DistancefromNewDev
      WHERE CompID = @CompID
  </code></pre>
  
  <p>END</p>
  
  <p>Here is my asp.net c# behind code:</p>
  
  <pre><code> protected void gvCompetition_RowUpdating(object sender, GridViewUpdateEventArgs e)
      {
          Label CompID = (Label)gvCompetition.Rows[e.RowIndex].FindControl("lblCompID");
          TextBox NewDevCount = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtNewDevCount");
          TextBox DevelopmentName = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtDevelopmentName");
          TextBox City = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtCity");
          TextBox State = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtState");
          TextBox ZipCodeofNewDev = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtZipCode");
          TextBox ProjectStatus = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtProjectStatus");
          TextBox ShoppingCenter = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtShoppingCenter");
          TextBox ProjectStartDate = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtProjectStartDate");
          TextBox ProjectDescription = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtProjectDescription");
          TextBox ProposedAnchorTenants = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtProposedAnchorTenants");
          TextBox GLA = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtGLA");
          TextBox EstCompDate = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtEstCompDate");
          TextBox Developer = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtDeveloper");
          TextBox BusinessUnit = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtBusinessUnit");
          TextBox BU = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtBU");
          TextBox CenterName = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtCenterName");
          TextBox MSA = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtMSA");
          TextBox BrixmorMSARank = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtBrixmorMSARank");
          TextBox Count = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtCount");
          TextBox Region = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtRegion");
          TextBox DistancefromNewDev = (TextBox)gvCompetition.Rows[e.RowIndex].FindControl("txtDistancefromNewDev");
          string ecompid = CompID.Text;
          string enewdevcount = NewDevCount.Text;
          string edevelopmentname = DevelopmentName.Text;
          string ecity = City.Text;
          string estate = State.Text;
          string ezipcode = ZipCodeofNewDev.Text;
          string eprojectstatus = ProjectStatus.Text;
          string eshoppingcenter = ShoppingCenter.Text;
          string eprojectstartdate = ProjectStartDate.Text;
          string eprojectdescription = ProjectDescription.Text;
          string eproposedanchor = ProposedAnchorTenants.Text;
          string egla = GLA.Text;
          string eestcompdate = EstCompDate.Text;
          string edeveloper = Developer.Text;
          string ebusinessunit = BusinessUnit.Text;
          string ebu = BU.Text;
          string ecentername = CenterName.Text;
          string emsa = MSA.Text;
          string ebrixmormsarank = BrixmorMSARank.Text;
          string ecount = Count.Text;
          string eregion = Region.Text;
          string edistancefromnewdev = DistancefromNewDev.Text;
  
          UpdateCompetition(ecompid, enewdevcount, edevelopmentname, ecity, estate, ezipcode, eprojectstatus, eshoppingcenter, eprojectstartdate, eprojectdescription, eproposedanchor,
              egla, eestcompdate, edeveloper, ebusinessunit, ebu, ecentername, emsa, ebrixmormsarank, ecount, eregion, edistancefromnewdev);
  
          gvCompetition.EditIndex = -1;
          BindCompetition();
      }
  
      protected void UpdateCompetition(string compid, string newdevcount, string developmentname, string city, string state, string zipcode,
          string projectstatus, string shoppingcenter, string projectstartdate, string projectdescription, string proposedanchor, string gla,
          string estcompdate, string developer, string businessunit, string bu, string centername, string msa, string brixmormsarank,
          string count, string region, string distancefromnewdev)
      {
          SqlConnection conn = new SqlConnection(cnnString);
          conn.Open();
          command = new SqlCommand();
          command.Connection = conn;
          command.CommandType = CommandType.StoredProcedure;
          command.CommandText = "CompDev_Update";
  
          command.Parameters.Add(new SqlParameter("@CompID", SqlDbType.Int));
          command.Parameters.Add(new SqlParameter("@NewDevCount", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@DevelopmentName", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@City", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@ZipCodeofNewDev", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@ProjectStatus", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@ShoppingCenter", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@ProjectStartDate", SqlDbType.Float));
          command.Parameters.Add(new SqlParameter("@ProjectDescription", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@ProposedAnchorTenants", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@GLA", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@EstCompDate", SqlDbType.Float));
          command.Parameters.Add(new SqlParameter("@Developer", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@BusinessUnit", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@BU", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@CenterName", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@MSA", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@BrixmorMSARank", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@Count", SqlDbType.NChar, 10));
          command.Parameters.Add(new SqlParameter("@Region", SqlDbType.NVarChar, 255));
          command.Parameters.Add(new SqlParameter("@DistancefromNewDev", SqlDbType.NChar, 10));
  
          command.Parameters["@CompID"].Value = Convert.ToInt32(compid.ToString());
          command.Parameters["@NewDevCount"].Value = newdevcount;
          command.Parameters["@DevelopmentName"].Value = developmentname;
          command.Parameters["@City"].Value = city;
          command.Parameters["@State"].Value = state;
          command.Parameters["@ZipCodeofNewDev"].Value = zipcode;
          command.Parameters["@ProjectStatus"].Value = projectstatus;
          command.Parameters["@ShoppingCenter"].Value = shoppingcenter;
          command.Parameters["@ProjectStartDate"].Value = projectstartdate;
          command.Parameters["@ProjectDescription"].Value = projectdescription;
          command.Parameters["@ProposedAnchorTenants"].Value = proposedanchor;
          command.Parameters["@GLA"].Value = gla;
          command.Parameters["@EstCompDate"].Value = estcompdate;
          command.Parameters["@Developer"].Value = developer;
          command.Parameters["@BusinessUnit"].Value = businessunit;
          command.Parameters["@BU"].Value = bu;
          command.Parameters["@CenterName"].Value = centername;
          command.Parameters["@MSA"].Value = msa;
          command.Parameters["@BrixmorMSARank"].Value = brixmormsarank;
          command.Parameters["@Count"].Value = count;
          command.Parameters["@Region"].Value = region;
          command.Parameters["@DistancefromNewDev"].Value = distancefromnewdev;
  
          da = new SqlDataAdapter(command);
          ds = new DataSet();
          da.Fill(ds);
  
          conn.Close();
      }
  </code></pre>
  
  <p>Here is my asp.net code:</p>
  
  <pre><code>&lt;asp:UpdatePanel runat="server" UpdateMode="Conditional"&gt;
      &lt;ContentTemplate&gt;
              &lt;asp:GridView ID="gvCompetition" OnPageIndexChanging="gvCompetition_PageIndexChanging" 
                  OnRowEditing="gvCompetition_RowEditing" OnRowCancelingEdit="gvCompetition_RowCancelingEdit"
                  OnRowUpdating="gvCompetition_RowUpdating"
                  runat="server" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" 
                  BorderWidth="1px" CellPadding="1" ForeColor="Black" GridLines="Vertical" 
                  AllowPaging="True" AutoGenerateColumns="False" Font-Size="10px"&gt;
                  &lt;AlternatingRowStyle BackColor="White" /&gt;
                  &lt;FooterStyle BackColor="#CCCC99" /&gt;
                  &lt;HeaderStyle BackColor="#7a1501" Font-Bold="True" ForeColor="White" /&gt;
                  &lt;PagerStyle BackColor="#ed2d22" ForeColor="Black" HorizontalAlign="Right" /&gt;
                  &lt;RowStyle BackColor="#f68121" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" /&gt;
                  &lt;SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /&gt;
                  &lt;SortedAscendingCellStyle BackColor="#FBFBF2" /&gt;
                  &lt;SortedAscendingHeaderStyle BackColor="#848384" /&gt;
                  &lt;SortedDescendingCellStyle BackColor="#EAEAD3" /&gt;
                  &lt;SortedDescendingHeaderStyle BackColor="#575357" /&gt;
                  &lt;Columns&gt;
                      &lt;asp:templatefield Headertext="ID"&gt;
                          &lt;itemtemplate&gt;
                              &lt;asp:label ID="lblCompID" runat="server" text='&lt;%#Eval("CompID") %&gt;'&gt;&lt;/asp:label&gt;
                          &lt;/itemtemplate&gt;
                      &lt;/asp:templatefield&gt;
  
                      &lt;asp:TemplateField HeaderText="New Dev Count"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblNewDevCount" runat="server" Text='&lt;%#Eval("NewDevCount") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtNewDevCount" Width="100%" runat="server" Text='&lt;%#Eval("NewDevCount") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Development Name"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblDevelopmentName" runat="server" Text='&lt;%#Eval("DevelopmentName") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtDevelopmentName" Width="100%" runat="server" Text='&lt;%#Eval("DevelopmentName") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="City"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblCity" runat="server" Text='&lt;%#Eval("City") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtCity" Width="100%" runat="server" Text='&lt;%#Eval("City") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="State"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblState" runat="server" Text='&lt;%#Eval("State") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtState" Width="100%" runat="server" Text='&lt;%#Eval("State") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Zip Code"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblZipCode" runat="server" Text='&lt;%#Eval("ZipCodeofNewDev") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtZipCode" Width="100%" runat="server" Text='&lt;%#Eval("ZipCodeofNewDev") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Project Status"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblProjectStatus" runat="server" Text='&lt;%#Eval("ProjectStatus") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtProjectStatus" Width="100%" runat="server" Text='&lt;%#Eval("ProjectStatus") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Shopping Center"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblShoppingCenter" runat="server" Text='&lt;%#Eval("ShoppingCenter") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtShoppingCenter" Width="100%" runat="server" Text='&lt;%#Eval("ShoppingCenter") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Project Start Date"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblProjectStartDate" runat="server" Text='&lt;%#Eval("ProjectStartDate") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtProjectStartDate" Width="100%" runat="server" Text='&lt;%#Eval("ProjectStartDate") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Project Description"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblProjectDescription" runat="server" Text='&lt;%#Eval("ProjectDescription") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtProjectDescription" Width="100%" runat="server" Text='&lt;%#Eval("ProjectDescription") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Proposed Anchor Tenants"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblProposedAnchorTenants" runat="server" Text='&lt;%#Eval("ProposedAnchorTenants") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtProposedAnchorTenants" Width="100%" runat="server" Text='&lt;%#Eval("ProposedAnchorTenants") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="GLA"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblGLA" runat="server" Text='&lt;%#Eval("GLA") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtGLA" Width="100%" runat="server" Text='&lt;%#Eval("GLA") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Est. Completion Date"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblEstCompDate" runat="server" Text='&lt;%#Eval("EstCompDate") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtEstCompDate" Width="100%" runat="server" Text='&lt;%#Eval("EstCompDate") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Developer"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblDeveloper" runat="server" Text='&lt;%#Eval("Developer") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtDeveloper" Width="100%" runat="server" Text='&lt;%#Eval("Developer") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Business Unit"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblBusinessUnit" runat="server" Text='&lt;%#Eval("BusinessUnit") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtBusinessUnit" Width="100%" runat="server" Text='&lt;%#Eval("BusinessUnit") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="BU"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblBU" runat="server" Text='&lt;%#Eval("BU") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtBU" Width="100%" runat="server" Text='&lt;%#Eval("BU") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="CenterName"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblCenterName" runat="server" Text='&lt;%#Eval("CenterName") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtCenterName" Width="100%" runat="server" Text='&lt;%#Eval("CenterName") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="MSA"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblMSA" runat="server" Text='&lt;%#Eval("MSA") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtMSA" Width="100%" runat="server" Text='&lt;%#Eval("MSA") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Brixmor MSA Rank"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblBrixmorMSARank" runat="server" Text='&lt;%#Eval("BrixmorMSARank") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtBrixmorMSARank" Width="100%" runat="server" Text='&lt;%#Eval("BrixmorMSARank") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Count"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblCount" runat="server" Text='&lt;%#Eval("Count") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtCount" Width="100%" runat="server" Text='&lt;%#Eval("Count") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Region"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblRegion" runat="server" Text='&lt;%#Eval("Region") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtRegion" Width="100%" runat="server" Text='&lt;%#Eval("Region") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
                      &lt;asp:TemplateField HeaderText="Distance from New Dev"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:Label ID="lblDistancefromNewDev" runat="server" Text='&lt;%#Eval("DistancefromNewDev") %&gt;'&gt;&lt;/asp:Label&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:TextBox ID="txtDistancefromNewDev" Width="100%" runat="server" Text='&lt;%#Eval("DistancefromNewDev") %&gt;'&gt;&lt;/asp:TextBox&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
  
  
                      &lt;asp:TemplateField HeaderText="Edit"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="btnEdit" Text="EDIT" runat="server" CommandName="Edit" /&gt;
  
                              &lt;span onclick="return confirm('Are you sure you want to delete this record')"&gt;
                                  &lt;asp:LinkButton ID="btnDelete" Text="DELETE" runat="server" CommandName="Delete" /&gt;
                              &lt;/span&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;EditItemTemplate&gt;
                              &lt;asp:LinkButton ID="btnUpdate" Text="UPDATE" runat="server" CommandName="Update" /&gt;
                              &lt;br /&gt;
                              &lt;asp:LinkButton ID="btnCancel" Text="CANCEL" runat="server" CommandName="Cancel" /&gt;
                          &lt;/EditItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                  &lt;/Columns&gt;
              &lt;/asp:GridView&gt;
      &lt;/ContentTemplate&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="gvCompetition" EventName="PageIndexChanging" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="gvCompetition" EventName="RowEditing" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="gvCompetition" EventName="RowUpdating" /&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="gvCompetition" EventName="RowCancelingEdit" /&gt;
      &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>What am I doing wrong that the update will not happen? And why am I not getting any errors thrown when it does not update?</p>