Hey,
I jsut got it working today. It suddenly updated the gridview AND the database without giving me some exceptions and syntax errors as before.
But here it is anyway :)
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Table view</h2>
<p>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:dbcssConnectionString %>"
ProviderName="<%$ ConnectionStrings:dbcssConnectionString.ProviderName %>"
SelectCommand="SELECT * FROM tableview"
UpdateCommand="UPDATE tableview SET Pad_No = @pad_no, Lift1 = @lift1, Lift2 = @lift2, Lift3 = @lift3, Task4 = @task4, Task5 = @task5, Task6 = @task6, Task7 = @task7, Task8 = @task8 WHERE row_No = @row_no">
<UpdateParameters>
<asp:Parameter Name="Pad_No" Type="String" />
<asp:Parameter Name="Lift1" Type="Int32" />
<asp:Parameter Name="Lift2" Type="Int32" />
<asp:Parameter Name="Lift3" Type="Int32" />
<asp:Parameter Name="Task4" Type="Int32" />
<asp:Parameter Name="Task5" Type="Int32" />
<asp:Parameter Name="Task6" Type="Int32" />
<asp:Parameter Name="Task7" Type="Int32" />
<asp:Parameter Name="Task8" Type="Int32" />
<asp:Parameter Name="row_No" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
</p>
</asp:Content>
And then I have on line of code in the Default.aspx.cs file:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//not working without that one ?
}
}
No methods like RowUpdating, RowUpdated, RowEditing etc, etc.
Isn't that strange though ?