I guess you would write this code in the DataSource_Selecting event.
Your "e" parameter would then be of type
SqlDataSourceSelectingEventArgs which exposes a Command object.

You already seem to have this part solved... is there another problem
that I have missed ?

On Dec 28, 11:13 pm, "m...@ni" <[email protected]> wrote:
> hi i just want to bind the sqldatasource to different stored
> procedures depending on some
> condition,i.e if BillId=1 then the stored procedure that is gona
> display paid bills are
> bound to that sqldatasource,which in return bind the result to the
> datalist control, and if
> BillId=2 then the stored procedure that is gona display unpaid bills
> are bound to that
> datalist.
> i have an idea to do that but i dont exactly know whr to do that e.g
>   if(BillId=1)
>     {
>         e.Command.CommandType=CommandType.StoredProcedure;
>         e.command.CommandText="Stored procedure of paid bills";
>     }
>    else
>     {
>         e.Command.CommandType=CommandType.StoredProcedure;
>         e.command.CommandText="Stored procedure of unpaid bills";
>     }

Reply via email to