T
Timothy V
Hi,
I was looking at this method within the SqlCommand class. It is the
SqlCommand.Parameter.Add(string, object) method.
My question is, how do I use this parameter within a stored procedure?
What i am really trying to do is dynamically change the ORDER BY method
within the SPROC. For example (i know this won't work):
CREATE PROCEDURE dbo.ClassFindAll
(
@sortBy VARCHAR(50)
)
AS
SELECT *
FROM Classes
ORDER BY @sortBy
Can anyone help?
Thank you,
Tim.
I was looking at this method within the SqlCommand class. It is the
SqlCommand.Parameter.Add(string, object) method.
My question is, how do I use this parameter within a stored procedure?
What i am really trying to do is dynamically change the ORDER BY method
within the SPROC. For example (i know this won't work):
CREATE PROCEDURE dbo.ClassFindAll
(
@sortBy VARCHAR(50)
)
AS
SELECT *
FROM Classes
ORDER BY @sortBy
Can anyone help?
Thank you,
Tim.