ConnectionArgument Class
Specifies a connection argument for a database connection.
Inheritance Hierarchy
System.Object
Microsoft.Web.Management.DatabaseManager.ConnectionArgument
Namespace: Microsoft.Web.Management.DatabaseManager
Assembly: Microsoft.Web.Management.DatabaseManager (in Microsoft.Web.Management.DatabaseManager.dll)
Syntax
'Declaration
Public Class ConnectionArgument
'Usage
Dim instance As ConnectionArgument
public class ConnectionArgument
public ref class ConnectionArgument
public class ConnectionArgument
The ConnectionArgument type exposes the following members.
Constructors
Method Type | Name | Description |
---|---|---|
ConnectionArgument | Creates a new instance of the ConnectionArgument class. |
Properties
Property Type | Name | Description |
---|---|---|
DefaultValue | Gets or sets the default value for the database connection argument. | |
IsPassword | Gets or sets a value that indicates whether the connection argument is a password. | |
IsRequired | Gets or sets a value that indicates whether the connection argument is required. | |
Name | Gets or sets a value that specifies the name of the connection argument. | |
Value | Gets or sets a value that specifies the value of the connection argument. |
Methods
Method Type | Name | Description |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
ToString | (Inherited from Object.) |
Examples
The following code sample illustrates an example ConnectionStringArgument property that returns the connection string arguments for a Microsoft Access database provider.
Public Overrides ReadOnly Property ConnectionStringArguments() _
As System.Collections.Generic.ICollection( _
Of Microsoft.Web.Management.DatabaseManager.ConnectionArgument)
Get
Dim argList As LinkedList(Of ConnectionArgument) = New LinkedList(Of ConnectionArgument)
Dim provider As ConnectionArgument = New ConnectionArgument
provider.Name = "Provider"
provider.DefaultValue = "Microsoft.Jet.OLEDB.4.0"
argList.AddLast(provider)
Dim database As ConnectionArgument = New ConnectionArgument
database.Name = "Data Source"
database.DefaultValue = "*.mdb"
database.IsRequired = True
argList.AddLast(database)
Dim password As ConnectionArgument = New ConnectionArgument
password.Name = "Jet OLEDB:Database Password"
password.DefaultValue = ""
password.IsRequired = False
password.IsPassword = True
argList.AddLast(password)
Return argList
End Get
End Property
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;
}
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for