grid view update
<p>I had grid view which bind sql  data source and added field to update data in grid view but it did not do any update and no error appeared  and I did not know where the error</p>

<p>SQL Stored Procedures:</p>

<pre><code>ALTER proc [dbo].[GetNewswithType]
As
Begin
Select News.Id,News.Type_Id,
News.Header,News.HText,News.DText,News.Active,News.Add_Date,
NewsType.Type_AR,NewsType.Type_EN
From News
Inner Join NewsType On 
NewsType.Id=News.Type_Id
End  

ALTER Proc [dbo].[UpdateNews]
(
@Id Int
,@Header Nvarchar(50)
,@HText Nvarchar(Max)
,@DText  Nvarchar(Max)
,@Type_Id Int
,@Active Bit

)
AS
BEGIN 
Update News Set 

@Header =Header 
,@HText =HText 
,@DText  =DText 
,@Type_Id=Type_Id
,@Active =Active 

WHERE @Id=Id
END
</code></pre>

<p>ASPX Page:</p>

<pre><code>&lt;div class="m10"&gt;
    &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" DataKeyNames="Id" DataSourceID="SDSNews" ForeColor="Black" 
        GridLines="Vertical" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
        onselectedindexchanging="GridView1_SelectedIndexChanging" 
            onpageindexchanging="GridView1_PageIndexChanging" AllowPaging="True" 
            onrowupdated="GridView1_RowUpdated" 
            onrowdatabound="GridView1_RowDataBound"&gt;
        &lt;FooterStyle BackColor="#CCCC99" /&gt;
        &lt;RowStyle BackColor="#F7F7DE" /&gt;
        &lt;Columns&gt;
            &lt;asp:CommandField HeaderText="Function" ShowEditButton="True" /&gt;
            &lt;asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" 
                Visible="False" /&gt;
            &lt;asp:BoundField DataField="Header" HeaderText="Header" 
                SortExpression="Header" /&gt;
            &lt;asp:BoundField DataField="HText" HeaderText="HomeText" 
                SortExpression="HText" /&gt;
            &lt;asp:BoundField DataField="DText" HeaderText="DetailsText" 
                SortExpression="DText" /&gt;
            &lt;asp:BoundField DataField="Type_Id" HeaderText="TypeNumber" 
                SortExpression="Type_Id" /&gt;
            &lt;asp:BoundField DataField="Type_AR" HeaderText="Type_AR" 
                SortExpression="Type_AR" InsertVisible="False" ReadOnly="True" /&gt;
            &lt;asp:BoundField DataField="Type_EN" HeaderText="Type_EN" 
                SortExpression="Type_EN" InsertVisible="False" ReadOnly="True" /&gt;
            &lt;asp:CheckBoxField DataField="Active" HeaderText="Active" 
                SortExpression="Active" /&gt;
            &lt;asp:BoundField DataField="Add_Date" HeaderText="Add_Date" 
                SortExpression="Add_Date" InsertVisible="False" ReadOnly="True" /&gt;
        &lt;/Columns&gt;
        &lt;PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" /&gt;
        &lt;SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /&gt;
        &lt;HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /&gt;
        &lt;AlternatingRowStyle BackColor="White" /&gt;
    &lt;/asp:GridView&gt;
        &lt;asp:SqlDataSource ID="SDSNews" runat="server" 
            ConnectionString="Data Source=ELARABY-1EACFA3\SQLEXPRESS;Initial Catalog=ElarabyGroup;Integrated Security=True" 
            ProviderName="System.Data.SqlClient" SelectCommand="GetNewswithType" 
            SelectCommandType="StoredProcedure" UpdateCommand="UpdateNews" 
            UpdateCommandType="StoredProcedure"&gt;
            &lt;UpdateParameters&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="Id" 
                    PropertyName="SelectedValue" Type="Int32" /&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="Header" 
                    PropertyName="SelectedValue" Type="String" /&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="HText" 
                    PropertyName="SelectedValue" Type="String" /&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="DText" 
                    PropertyName="SelectedValue" Type="String" /&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="Type_Id" 
                    PropertyName="SelectedValue" Type="Int32" /&gt;
                &lt;asp:ControlParameter ControlID="GridView1" Name="Active" 
                    PropertyName="SelectedValue" Type="Boolean" /&gt;
            &lt;/UpdateParameters&gt;
        &lt;/asp:SqlDataSource&gt;
    &lt;/div&gt;
</code></pre>
