G
Guest
In some cases I would like to allow a user to select a row from a GridView to
update in another page using a DetailsView form (passing the key in
QueryString).
In other cases I would like to use the same DetailsView form to allow
general edit/insert/delete functions with Paging=true.
I can't figure out how to change the select statement from one case to the
other, e.g. if I have an SqlDataSource with:
SelectCommand="SELECT [VanId], ... [Active] FROM [Vans] WHERE
(VanId=@VanId)"
<SelectParameters>
<asp:QueryStringParameter QueryStringField="pk" Name="VanId" ... />
</SelectParameters>
How do I change the SelectCommand on the fly, e.g. when I want general
editing I would like to use:
SelectCommand="SELECT [VanId], ... [Active] FROM [Vans]"
and not use WHERE clause.
Any suggestions would be appreciated.
update in another page using a DetailsView form (passing the key in
QueryString).
In other cases I would like to use the same DetailsView form to allow
general edit/insert/delete functions with Paging=true.
I can't figure out how to change the select statement from one case to the
other, e.g. if I have an SqlDataSource with:
SelectCommand="SELECT [VanId], ... [Active] FROM [Vans] WHERE
(VanId=@VanId)"
<SelectParameters>
<asp:QueryStringParameter QueryStringField="pk" Name="VanId" ... />
</SelectParameters>
How do I change the SelectCommand on the fly, e.g. when I want general
editing I would like to use:
SelectCommand="SELECT [VanId], ... [Active] FROM [Vans]"
and not use WHERE clause.
Any suggestions would be appreciated.