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

Verifies the database dependencies for your provider.

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

'Usage

Dim instance As DatabaseProvider

instance.VerifyDependencies()

'Declaration

Public Overridable Sub VerifyDependencies
Remarks

You can optionally implement the VerifyDependencies method to verify any dependencies that your database provider may have. This method takes no parameters and does not have a return value; your database provider should raise an exception by using the DependenciesMissingException class if the operating system environment does not meet your database provider's dependencies.

Examples

The following code sample illustrates an example VerifyDependencies method that verifies the dependencies for a sample OLEDB provider.


    ' Verify the database provider dependencies.
    Public Overrides Sub VerifyDependencies()

        Try
            ' Create a database provider factory for OLEDB.
            Dim oledbFactory As DbProviderFactory = _
                DbProviderFactories.GetFactory("System.Data.OleDb")
            ' Test for null.
            If (Not (oledbFactory) Is Nothing) Then
                ' Create an assembly name class.
                Dim name As AssemblyName = _
                    New AssemblyName(oledbFactory.GetType.Assembly.FullName)
                ' Test the version to make sure that it's greater than 1.
                If (name.Version.Major < 1) Then
                    ' Raise an exception if the version is not sufficient.
                    Throw New DependenciesMissingException("http://www.iis.net/")
                End If
            End If
        Catch
            ' Throw an exception when an error occurs.
            Throw New DependenciesMissingException("http://www.iis.net/")
        End Try

    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