Hi,
In a single webmethod in .net webservice there are 4 times DB hit (for different tables), apart from using stored procedures, is there any means which i can follow to reduce the db hit?
Hi,
In a single webmethod in .net webservice there are 4 times DB hit (for different tables), apart from using stored procedures, is there any means which i can follow to reduce the db hit?
Write a single query that collects all the data you require.
There is almost always a way to do one query.
Select A.A1, A.A2, A.A3, B.B1, B.B2, B.B3
From TableB B
Inner Join (
Select A1, A2, A3
From TableA
Where A1 = @Id
) A On B.B1 = A.A2
Look into ASP.Net Data Caching.
You can keep your result set for the duration of your request, and even longer, reducing your database round trips.
Use caching to store values from the database in server memory. There are many options here, depending on what you need.