DatabaseProvider.ConnectionStringArguments Property

IIS 7.0

Gets a collection that contains the collection of database connection arguments.

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

public abstract ICollection<ConnectionArgument> ConnectionStringArguments { get; }

Property Value

Type: System.Collections.Generic.ICollection<ConnectionArgument>
A read-only ICollection object that contains a ConnectionArgument collection.

Your provider must implement the ConnectionStringArguments property in order to define the connection string arguments that your database provider requires.

The following code sample illustrates an example ConnectionStringArguments property that returns the connection string arguments for a Microsoft Access database provider.



        public override ICollection<ConnectionArgument> ConnectionStringArguments
        {
            get
            {
                LinkedList<ConnectionArgument> argList = new LinkedList<ConnectionArgument>();

                ConnectionArgument provider = new ConnectionArgument();
                provider.Name = "Provider";
                provider.DefaultValue = "Microsoft.Jet.OLEDB.4.0";
                argList.AddLast(provider);

                ConnectionArgument database = new ConnectionArgument();
                database.Name = "Data Source";
                database.DefaultValue = "*.mdb";
                database.IsRequired = true;
                argList.AddLast(database);

                ConnectionArgument password = new ConnectionArgument();
                password.Name = "Jet OLEDB:Database Password";
                password.DefaultValue = "";
                password.IsRequired = false;
                password.IsPassword = true;
                argList.AddLast(password);

                return argList;
            }
        }



Show: