I have an SQL query but it will will only know the movie type in page load. This will be connected to a datalist.
My query is
select * from movies where movieType = @type
Is there a way to pass parameters at runtime to the sql datasource?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to add the parameter to your SqlCommand when you make your SQL call.
In this example, the variable you are passing in from .Net is ‘type’
This MSDN article should help you understand parameter passing.