G
Guest
I am using data access block(MABD) provided Micrososft. I am having error of
too many connections by MDAB. I want to modify it's code or some other way to
tackle this problem.I have also turned off connection pooling but it worked
for a little while but still I had the same problem. I am pasting a piece of
code of MADB.a help on this matter would be highly appreciated.
public static int ExecuteNonQuery(SqlConnection connection, CommandType
commandType, string commandText, params SqlParameter[] commandParameters)
{
if( connection == null ) throw new ArgumentNullException( "connection" );
// Create a command and prepare it for execution
SqlCommand cmd = new SqlCommand();
bool mustCloseConnection = false;
PrepareCommand(cmd, connection, (SqlTransaction)null,
commandType, commandText, commandParameters, out mustCloseConnection );
// Finally, execute the command
int retval = cmd.ExecuteNonQuery();
// Detach the SqlParameters from the command object, so they can
be used again
cmd.Parameters.Clear();
if( mustCloseConnection )
connection.Close();
return retval;
}
too many connections by MDAB. I want to modify it's code or some other way to
tackle this problem.I have also turned off connection pooling but it worked
for a little while but still I had the same problem. I am pasting a piece of
code of MADB.a help on this matter would be highly appreciated.
public static int ExecuteNonQuery(SqlConnection connection, CommandType
commandType, string commandText, params SqlParameter[] commandParameters)
{
if( connection == null ) throw new ArgumentNullException( "connection" );
// Create a command and prepare it for execution
SqlCommand cmd = new SqlCommand();
bool mustCloseConnection = false;
PrepareCommand(cmd, connection, (SqlTransaction)null,
commandType, commandText, commandParameters, out mustCloseConnection );
// Finally, execute the command
int retval = cmd.ExecuteNonQuery();
// Detach the SqlParameters from the command object, so they can
be used again
cmd.Parameters.Clear();
if( mustCloseConnection )
connection.Close();
return retval;
}