Your DeleteCommand and UpdateCommand commands do not use the same key as the DataKeyNames FormView . They should be something like this:
DeleteCommand="DELETE FROM [Common] WHERE [Project_Key] = @ProjectKey" UpdateCommand="UPDATE [Common] " + "SET [Project_Name] = @ProjectName, [Business_Category] = @BusinessCategory, [Project_Description] = @ProjectDescription, [Operations_Owner] = @OperationsOwner" + "WHERE Project_Key=@ProjectKey >"
The DataKeyNames property is used to control automatic UPDATE and DELETE performed using FormView , so it must be the primary key in your table, and it must match in all three places (UpdateCommand, DeleteCommand, and DataKeyNames). From MSDN :
Use the DataKeyNames property to specify a list of field names, separated by commas, that represent the primary key of the data source.
(In the sample code on this page, you will see that the parameter used in the WHERE clause for UpdateCommand matches the value specified in the DataKeyNames FormView )
As a side note, in the code you provided, your UpdateCommand does not use the where clause at all. This means that it will update every record in your table with the same set of values. FYI =)
Edit: When you use a FormView like this, you don't need the UpdateParameters settings the way you use them (since you use two-way data binding on the controls in your templates for editing / pasting). Try this for your SQLDataSource
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hulc01ConnectionString %>" SelectCommand="SELECT * FROM [Common]" InsertCommand="INSERT INTO [Common] ([Project_Name], [Business_Category], [Project_Description], [Operations_Owner]) VALUES (@Project_Name, @Business_Category, @Project_Description, @Operations_Owner)" DeleteCommand="DELETE FROM [Common] WHERE [ProjectKey] = @ProjectKey" UpdateCommand="UPDATE [Common] SET [Project_Name] = @Project_Name, [Business_Category] = @Business_Category, [Project_Description] = @Project_Description, [Operations_Owner] = @Operations_Owner WHERE ProjectKey=@ProjectKey " > </asp:SqlDataSource>
I usually use UpdateParameters, DeleteParameters, etc. when I do not use FormView , or I need to filter them based on the control outside of FormView . Let me know if this does not do it for you.