Connecting Progress DB in ASP.Net

Matias Borra

New Member
Hi,

I´m developing an ASP.Net project (C#) connecting a Progress 9.1E04 database. The problem that I have is that the application connect the database correctly, the database send the data correctly, but it never disconnect the user used to establish the connection. So, everytime I run a query, a new user is connected to the database and left connected to it.

This is an example of a query:

SQL = "SELECT * " +
"FROM empresas " +
"ORDER BY empresas.EMP_Razon_Social";
using (OdbcConnection connection = new OdbcConnection(ConnStr))
{
OdbcCommand command = new OdbcCommand();
OdbcTransaction transaction = null;
command.Connection = connection;
try
{
connection.Open();
// Start a local transaction.
transaction = connection.BeginTransaction();
// Assign transaction object for a pending local transaction
command.Transaction = transaction;
// Execute the command
command.CommandText = SQL;
using (OdbcDataReader DR = command.ExecuteReader())
{
while (DR.Read())
{
o_empresas = new Empresas();
SetPropiedades(o_empresas, DR);
lstEmp.Add(o_empresas);
}
DR.Close();
}
// Attempt to commit the transaction.
transaction.Commit();
}
catch (Exception ex)
{
throw ex;
}
}

According to ASP.Net, the connection should be closed automatically when the "using" cycle is ended, and even though I explicitly close it, the user will remain connected to the database until the database kills it by itself (after several minutes).

Could anyone tell me how to work correctly with Progress DB and ASP.Net?

Thanks in advance,
Matías.
 
Top