DatabaseProvider..::.TestConnection Method Home
.NET Framework Class Library
DatabaseProvider..::.TestConnection Method

Tests a connection string for a database provider.

Namespace:  Microsoft.Web.Management.DatabaseManager
Assembly:  Microsoft.Web.Management.DatabaseManager (in Microsoft.Web.Management.DatabaseManager.dll)
Syntax

'Usage

Dim instance As DatabaseProvider
Dim connectionString As String

instance.TestConnection(connectionString)

'Declaration

Public MustOverride Sub TestConnection ( _
    connectionString As String _
)

Parameters

connectionString
Type: System..::.String
The connection string to test.
Remarks

Your provider must implement the TestConnection method in order to test the database connection for your provider.

Examples

The following code sample illustrates an example TestConnection method that opens and closes a database that will test the connection.


    Public Overrides Sub TestConnection(ByVal connectionString As String)

        Dim connection As OleDbConnection = New OleDbConnection(connectionString)
        connection.Open()
        connection.Close()

    End Sub



Permissions

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .
See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View