Managing a database connection in an asp.net application

I would like to know what would be the best way to manage a database connection in asp.net.

My application is built using N-tier architecture. DAL consists of static classes with methods such as

Public Shared Sub Delete( _
    ByVal connection As MyConnectionClass, _
    ByVal contact_id As Integer, _
    ByVal contact_timestamp As Date _
)

    With connection.ProcParams
        .Add(New StoredProcParam("p_contact_id", contact_id, OracleDbType.Int32))
        .Add(New StoredProcParam("p_contact_timestamp", contact_timestamp, OracleDbType.Date))
    End With

    connection.Execute("PKG_DATA_ACCESS.DeleteContact")

End Sub

It should be noted here that I am passing the DAL connection from the BLL.

These are the points that I considered, but none of them suits me, so I just ask for advice.

Should I create connections in MasterPage, store it in the object, and then transfer it to my business objects as they are created (which I try to avoid)

, CreateConnection, - (- , , d , , asp.net , )

Windows Forms ( )

+5
1

. , ..Net , asp.net.

- , , .

BC:

, .

+13

All Articles