SqlDataAdapter.Fill is very slow with multiple result set

520 Views Asked by At

In my stored procedure, I am returning 13 tables. In management studio, proc is taking around 150ms-250ms to execute which is fine. In my asp.net core (c#) project, I filled the dataset with that procedure and here it takes more than 20 seconds or sometimes 35+ seconds to fill dataset via sqldataadapter. Can anyone please help me optimize this, so that data can be filled quickly. Below is the code

Stored Procedure enter image description here

C# Code enter image description here

Update: I tried SqlDataAdapter with Add instead AddWithValue but result is same. No improvement at all. enter image description here

0

There are 0 best solutions below