In my sqlDataConnection I have :

//=============================================================
        <asp:SqlDataSource
        id="srcProfileView"
        ConnectionString="<%$ ConnectionStrings:webBlog %>"
        SelectCommandType="StoredProcedure"
        SelectCommand="profileInfo"
        Runat="server">

       <SelectParameters>
            <asp:Parameter Name="UserId" Type="String" Size="100"
DefaultValue="Untitled"/>
       </SelectParameters>
       </asp:SqlDataSource>
//=============================================================


However, I want to make the value of "UserId" dynamic with what's
being passed in from the URL, I took out the <selectparameter> tag and
in my Page_load I did the following:


//=============================================================
    void Page_Load()
    {
        String UserId = Page.Request.Params.Get("UserId");
        srcProfileView.SelectParameters.Add(new
Parameter(@UserId,TypeCode.String,UserId));
    }
//=============================================================


>From what I understand this should Add a new parameter to the
sqlDataConnection control with the name "UserId" and whatever the
value of UserId is.  However I'm getting the error that my stored
procedure expects a value for @UserId.  Any insight?

Thanks

Reply via email to