Hi James,
In order to make it work you have to handle SqlDataSource.Selecting event:
<asp:SqlDataSource runat="server" ID="ds" SelectCommand="whatever"
OnSelecting="ds_Selecting"></asp:sqlDataSource>
protected void ds_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
e.Command.CommandText = SQLWhereClause;
}
You should be fine from this point.
Regards

Signature
Milosz
> I have a need to change the select command based on user input (dropdown
> lists 1 and 2). I'm using a GridView command that is tied to a
[quoted text clipped - 42 lines]
>
> What am I doing wrong, please?1
James R. Davis - 01 Dec 2007 16:44 GMT
Thank you, sir.
It seems that some of you have the huge number of 'factoids' needed to be
proficient at ASP.NET at your finger tips. I wonder how long it takes to
get to the point that virtually any new coding problem becomes simply a
matter of knowing where to look for a brief refresher of the details?
Entry level is really intimidating to me and I've been coding for decades.
> Hi James,
>
[quoted text clipped - 58 lines]
> >
> > What am I doing wrong, please?1
Milosz Skalecki [MCAD] - 01 Dec 2007 23:31 GMT
Howdy James,
It's just a coincidence as I have solved similar problem recently :) VS
debugger and Reflector helped to realise SelectCommand is not stored in the
viewstate and it's set before Selecting event, so the only place you can
amend its value is Command property. So as you see it's just a matter of
investigation :)
Take care!

Signature
Milosz
> Thank you, sir.
>
[quoted text clipped - 74 lines]
> > >
> > > What am I doing wrong, please?1
James R. Davis - 02 Dec 2007 00:58 GMT
Great help, sir. I used a slightly different approach but your advice led
the way.
Jim
> Howdy James,
>
[quoted text clipped - 5 lines]
>
> Take care!