I am trying to pass the stored procedure a value for the Order By clause in the behind code of my asp site. I every time I try to pass it a value that is in the db I get the following error: In correct syntax near Product. Product is a value in the db I want to order by. How can I pass this or any other db value to be sorted by to my stored procedure?
return App_Code.DBHelper.executeDataSetSP(App_Code.DBHelper.getConnection(), "GetOrderDataByDate",
new SqlParameter[] { new SqlParameter("@start", StartDate),
new SqlParameter("@end", EndDate),
new SqlParameter("@OrderBy", "Product") }).Tables[0];