C# .NET - i have the use the dropdown selected datavalue (which is an int) in my sql select query.

Asked By manoj gupta on 15-Sep-13 12:08 PM
this is my dropdown

 DropDownList2.DataSource = dt;
        DropDownList2.DataTextField = "Name";
        DropDownList2.DataValueField = "ID";
        DropDownList2.DataBind();

this is my sql query:

SELECT S.UserID, S.TargetID, S.ApplicationID from System_Log S where S.ApplicationID=_________________________

here i have to check with the value that is selected from deopdown list( value field id integer) please write back me the sql query.

Thanks in advance. :)
ravindra patil replied to manoj gupta on 16-Sep-13 01:58 AM
in your code behind
SELECT S.UserID, S.TargetID, S.ApplicationID from System_Log S
 where S.ApplicationID='"+DropDownList2.SelectedValue+"'