Last post Feb 24, 2010 09:18 AM by cnranasinghe
Feb 10, 2010 01:38 AM|pathipati|LINK
how to check database connectivity in enterprise library 4.1?
Feb 10, 2010 12:04 PM|cnranasinghe|LINK
Is it availability of database or activedata connection? Can you explain in detail?
Feb 16, 2010 03:58 AM|vijay1243|LINK
how we can check both?
Feb 24, 2010 09:18 AM|cnranasinghe|LINK
Sorry for the delayed answere. Hope this will help.
Private Sub SaveRecord()
Dim _Connection As DbConnection = Nothing
Dim _Transaction As DbTransaction = Nothing
Dim _DB As Database = DatabaseFactory.CreateDatabase("PPConnectionString")
_Connection = _DB.CreateConnection
_Transaction = _Connection.BeginTransaction()
//Do something here, adding required parameters
Catch ex As Exception
If _Connection.State = ConnectionState.Open Then
Note the _Connection.State section, you can check status of the connection.