J
jmacduff
Big question: How to enable edit/update commands to work when setting
the sqldatasource select command from code behind.
Details:
I have a GridView using a sqldatasouce with the select and update
commands set. The gridview is part of a "admin" page where the admin
will view the data, then use the gridview edit/update buttons to update
the data.......that all works great.
However now we want to add a "search" function since the dataset is
pretty big.... so in the codebehind I do this:
//update the select command with a search syntax
this.MusicNamesqlSource.SelectCommand = "EXEC foo.foo_SearchDB " + "'"
+ this.foodbAccess.SafeSqlLiteral(szSearchTerm) + "'";
//rebind the gridview so the select command fires
this.MusicNamesGridView.DataBind();
So that works.. it does display the altered results.. however THEN the
edit buttons dont work! The update command hasnt changed.. but when the
user clicks "update" the update command doesnt work... it doesnt break
or anything.. it simply doesnt work
-Jeff
the sqldatasource select command from code behind.
Details:
I have a GridView using a sqldatasouce with the select and update
commands set. The gridview is part of a "admin" page where the admin
will view the data, then use the gridview edit/update buttons to update
the data.......that all works great.
However now we want to add a "search" function since the dataset is
pretty big.... so in the codebehind I do this:
//update the select command with a search syntax
this.MusicNamesqlSource.SelectCommand = "EXEC foo.foo_SearchDB " + "'"
+ this.foodbAccess.SafeSqlLiteral(szSearchTerm) + "'";
//rebind the gridview so the select command fires
this.MusicNamesGridView.DataBind();
So that works.. it does display the altered results.. however THEN the
edit buttons dont work! The update command hasnt changed.. but when the
user clicks "update" the update command doesnt work... it doesnt break
or anything.. it simply doesnt work
-Jeff