J
Joe
I'm running through a loop calling a stored procedure each time. I prepare
the SqlCommand before entering the loop and just change the param values in
the loop before each call to ExecuteNonQuery(). The problem I get is it's
taking anywhere from 1/4 - 1/2 second before each call is made. I verified
this using the SQL Profiler and comparing the start times of each call. The
start and complete times are the same so the SP is executing very fast.
What's even weirder is that this doesn't happen all the time. Some times it
runs very, very fast.
The application is being run on the database server and I'm using the IP
address in the ConnectionString.
The loop its self it pretty simple
foreach (Item i in Items)
{
int itemRow = dataview.Find(a string) // note this dataview contains
8800 records
if (itemRow == -1)
continue;
// assign param values
....
try
{
cmd.ExecuteNonQuery()
}
catch (Exception ex)
{
LogMsg...
}
}
Any suggestions would be greatly appreciated.
-Joe
the SqlCommand before entering the loop and just change the param values in
the loop before each call to ExecuteNonQuery(). The problem I get is it's
taking anywhere from 1/4 - 1/2 second before each call is made. I verified
this using the SQL Profiler and comparing the start times of each call. The
start and complete times are the same so the SP is executing very fast.
What's even weirder is that this doesn't happen all the time. Some times it
runs very, very fast.
The application is being run on the database server and I'm using the IP
address in the ConnectionString.
The loop its self it pretty simple
foreach (Item i in Items)
{
int itemRow = dataview.Find(a string) // note this dataview contains
8800 records
if (itemRow == -1)
continue;
// assign param values
....
try
{
cmd.ExecuteNonQuery()
}
catch (Exception ex)
{
LogMsg...
}
}
Any suggestions would be greatly appreciated.
-Joe