From: giorgi giorgi [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2008 12:23
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] ExecuteReader is slow
Running a recursive cte against a table with about 1600 rows from my program
needs the same time so I think it's providers issue.
Here is source code:
FbCommand cmd = BuildCommand(DbCommand);
cmd.Parameters.AddWithValue("@from", From);
cmd.Parameters.AddWithValue("@to", To);
cmd.Parameters.AddWithValue("@code", Code);
try
{
cmd.Connection.Open();
//This needs 0.028 seconds.
return cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
[PM] Can you close the connection after executing all 2000 commands, and not
for each iteration???
[PM] something like
FbCommand cmd = BuildCommand(DbCommand);
cmd.Parameters.AddWithValue("@from", From);
cmd.Parameters.AddWithValue("@to", To);
cmd.Parameters.AddWithValue("@code", Code);
try
{
cmd.Connection.Open();
Foreach (your iteration)
{
return cmd.ExecuteReader()
}
}
Catch()
{
}
Finally
{
cmd.Connection.close()
}
Regards,
Paul
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider