R8VI
asked on
sql data source pass a variable, c#, asp.net
Hi I have the follwoing code
in aspx page
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LiveConn ectionStri ng %>"
SelectCommand="select commentsleftby, comments from ratingsandcomments where Video_ID = @videoid ">
<SelectParameters>
<asp:parameter name="videoid" defaultvalue ="" />
</SelectParameters>
</asp:SqlDataSource>
c# page
protected void _data_Selecting(object sender, SqlDataSourceSelectingEven tArgs
e)
{
e.Command.Parameters["vide oid"].Valu e = Request.QueryString["Video "].ToStrin g();
}
what i want to do is get the value from the query string and pass it into the datasource
what am i doing wrong
thanks,
R8VI
in aspx page
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LiveConn
SelectCommand="select commentsleftby, comments from ratingsandcomments where Video_ID = @videoid ">
<SelectParameters>
<asp:parameter name="videoid" defaultvalue ="" />
</SelectParameters>
</asp:SqlDataSource>
c# page
protected void _data_Selecting(object sender, SqlDataSourceSelectingEven
e)
{
e.Command.Parameters["vide
}
what i want to do is get the value from the query string and pass it into the datasource
what am i doing wrong
thanks,
R8VI
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.