ConnectionTimeout = "Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error."
CommandTimeout = "Gets or sets the wait time before terminating the attempt to execute a command and generating an error."
I am using a shared Database class so that I only need to change the DatabaseSpecificAdapter in one place if I change the database type in the future.
Would this work for you?
' code in your business layer
Using adapter as IDataAccessAdapter = Database.GetAdapter(45)
adapter.SaveEntity(myEntity)
End Using
' shared Database class in project
Public Class DataBase
Public Shared Function GetAdapter() As _
SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter
Dim adapter As SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter = _
New HTI.Data.DatabaseSpecific.DataAccessAdapter
Return adapter
End Function
Public Shared Function GetAdapter(ByVal Timeout As Integer) As _
SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter
Dim adapter As SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter = _
GetAdapter()
adapter.CommandTimeOut = Timeout
Return adapter
End Function
End Class