EasyHostingASP.NET | Best and cheap ASP.NET Hosting. t is not good to execute multiple db request for loading single page.  Review your database code to see if you have request paths that go to the database more than once. Each of those round-trips decreases the number of requests per second your application can serve. By returning multiple resultsets in a single database request, you can cut the total time spent communicating with the database.

database_2

In order to improve performance you should execute single stored proc and bring multiple resultset in to single db request.  In this article i will explain you how to avoid multiple database request and how to bring multiple resultset into single db request.

Consider a scenario of loading a Product Page, which displays

  • Product Information and
  • Product Review Information

In order to bring 2 database request in single db request, your sql server stored proc should be declared as below.

SQL Server Stored Proc

Asp.net, C# Code to bring multiple db request into single db request

Code Inside Data Access Class Library (DAL)

Code Inside Asp.net .aspx.cs page

Finish, Happy coding.

Best and Cheap ASP.NET Hosting in India Click Here !

Alexia Pamelov