It works fine and updates the table using the onRowUpdating event of the
GridView.
But I am getting the error:
Updating is not supported by data source 'SqlDataSource1' unless
UpdateCommand is specified.
I don't want the SqlDataSource1 to update my tables, I would like it to
redisplay the line I changed, however.
Someone suggested I try setting:
GridView1.EditIndex = -1
But that didn't work.
Is there a way around this?
Thanks,
Tom
Procedure has no parameters and parameters were supplied.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectString %>"
SelectCommand="GetResponseFileExceptions"
SelectCommandType="StoredProcedure"
UpdateCommand="UpdateDummy"
UpdateCommandType="StoredProcedure"></asp:SqlDataSource>
I don't see any parameters???
Thanks,
Tom
"tshad" <to...@pdsa.com> wrote in message
news:%23Bq7a77...@TK2MSFTNGP04.phx.gbl...
But how do I tell it not to update at all?
I want to handle it myself. There would actually be a couple of ways I need
to call my update statement with different parameters and actually different
Stored procedures.
That was why I was doing it in the onRowUpdating event of the GridView.
Thanks,
Tom
"tshad" <to...@pdsa.com> wrote in message
news:%23%234MzA8O...@TK2MSFTNGP05.phx.gbl...
You have to cancel the update and set EditIndex = -1 in the RowUpdating
event of the GridView:
public void GridView1_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
e.Cancel = true; // Prevents error on not including
UpdateMethod in SDS
... Some Code
GridView1.EditIndex = -1;
}
Need both to prevent the error.
"tshad" <to...@pdsa.com> wrote in message
news:uvE9aXGP...@TK2MSFTNGP06.phx.gbl...