I want to conditionally call update statement on sqldatasource. I have a gridview and sqldatasource assigned to it. I handle gridview_updating event. If I do not assign sqldatasource.updatecommand to it (when some condition does not meet), I get error: "Updating is not supported by data source unless UpdateCommand is specified."
How can I suppress this error message?
Thanks in advance:)
EDIT:
This is my command event of gridview:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
if(someconditionmatch)
sqldatasource1.UpdateCommand = "some update query";
else
{
//do nothing...but when do do nothing...it throws error that some update command has to compulsorily assigned...This is my problem...which updateCommand should I assign if I do not want to update anything???
}
}
}