Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

Run different stored procedures based on user input

I have an ASP.Net page (C# code behind) that displays data in a grid. The OnLoad event runs a stored procedure to get the data from the database and display the grid (an asp:repeater, actually). I have placed 5 buttons at the top of the page. When the page is loaded (as a user comes to it) a default stored procedure is run. I want each of the buttons to run a different stored procedure that accepts a different parameter. Right now, the page opens and displays all open records. When clicking the Archived button, all archived records will display. When clicking the Returned records, all of the records marked as returned will display. And so on. The parameter is simple, a status field that is a number. What would be the best way to implement this?
0
dodgerfan
Asked:
dodgerfan
1 Solution
 
plusone3055Commented:
0
 
EyalCommented:
if all the data is already in the client side, add class to the rows and with jquery hide/show relevant rows.
if server side you have at least 2 options
1) use linq to filter the result (to better performance save the first result and use it in the next page calls)
2) pass a parameter to the stored procedure that will filter records as needed
0
 
dodgerfanAuthor Commented:
Perfect, thanks.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now