dotConnect for MongoDB Documentation
Devart.Data.MongoDB Namespace / MongoDBConnection Class
Properties Methods Events


On this page
    MongoDBConnection Class Members
    On this page

    The following tables list the members exposed by MongoDBConnection.

    Public Constructors
     NameDescription
    Public ConstructorOverloaded. Initializes a new instance of the MongoDBConnection class.  
    Top
    Public Properties
     NameDescription
    Public PropertyOverridden. Gets or sets the string used to open the connection. Setting it closes the connection if it is open. The default value is an empty string.  
    Public PropertyGets or sets the time, in seconds, to wait while trying to open a connection before an error is generated. The default value is 30.  
    Public Property (Inherited from System.ComponentModel.Component)
    Public PropertyGets or sets the database the connection works with. The default value is an empty string.  
    Public PropertyOverridden. Gets the name of the server to connect to; returns the value of the Host property.  
    Public PropertyGets or sets the name or IP address of the MongoDB server. The default value is an empty string, which means localhost.  
    Public PropertyIndicates whether the connection is enlisted in a distributed transaction. (Inherited from Devart.Common.DbConnectionBase)
    Public PropertyGets or sets name of the component. (Inherited from Devart.Common.DbConnectionBase)
    Public PropertyGets or sets the folder that contains libmongoc-1.0.dll, libbson-1.0.dll, and sqlite3.dll. The default value is an empty string.  
    Public PropertyGets or sets a form or other container that the Devart.Common.DbConnectionBase instance belongs to. (Inherited from Devart.Common.DbConnectionBase)
    Public PropertyGets or sets the password for the connection. The default value is an empty string.  
    Public PropertyGets or sets the port the MongoDB server listens on. The default value is 27017.  
    Public PropertyGets or sets how a data reader returns documents in the native mode (Sql Engine=false): a column per field or the whole document as one value (see MongoDBReaderType). The default value is MongoDBReaderType.Default.  
    Public PropertyGets a string containing the version of the instance of the server to which the client is connected. (Inherited from Devart.Common.DbConnectionBase)
    Public Property (Inherited from System.ComponentModel.Component)
    Public PropertyGets or sets a value indicating whether commands are SQL statements over collections as tables (true) or MongoDB database commands in JSON (false). The default value is true.  
    Public PropertyGets or sets the current state of the connection. Setting it to Open or Closed opens or closes the connection.  
    Public PropertyGets or sets the user name for the connection. The default value is an empty string.  
    Top
    Protected Properties
     NameDescription
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Internal Property (Inherited from Devart.Common.DbConnectionBase)
    Protected PropertyOverridden. Gets the connection timeout from the current connection options; 30 when no connection string is set.  
    Protected PropertyOverridden. Gets or sets the database of the connection; the same as the Database property.  
    Protected Property (Inherited from System.Data.Common.DbConnection)
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Property (Inherited from System.ComponentModel.Component)
    Protected Property (Inherited from Devart.Common.DbConnectionBase)
    Top
    Public Methods
     NameDescription
    Public MethodStarts an asynchronous invocation of an Open method. (Inherited from Devart.Common.DbConnectionBase)
    Public MethodOverloaded. Begins a transaction at the database.  
    Public MethodOverridden. Changes the current database. An open connection is closed and opened again with the new database.  
    Public MethodCreates a new MongoDBConnection object that is a copy of the current instance.  
    Public MethodCloses the connection to the database. This is the preferred method of closing any open connection. (Inherited from Devart.Common.DbConnectionBase)
    Public MethodCreates and returns a MongoDBCommand object associated with the connection.  
    Public Method (Inherited from System.MarshalByRefObject)
    Public MethodOverloaded.  (Inherited from Devart.Common.DbConnectionBase)
    Public MethodEnds an asynchronous invocation of the Open method. (Inherited from Devart.Common.DbConnectionBase)
    Public MethodEnlists in the specified transaction. (Inherited from Devart.Common.DbConnectionBase)
    Public Method (Inherited from System.MarshalByRefObject)
    Public MethodOverloaded. Returns list of metadata collections and number of restrictions for a collection. (Inherited from Devart.Common.DbConnectionBase)
    Public Method (Inherited from System.MarshalByRefObject)
    Public Methodstatic (Shared in Visual Basic)Loads the specified license key for the application, so that connections can open without the License Key connection string parameter.  
    Public MethodOverridden. Opens a connection with the settings specified by the ConnectionString property. Loads the native libraries (libmongoc, libbson, sqlite3) on the first call; throws System.InvalidOperationException if the connection string is not set.  
    Public MethodOverloaded.  (Inherited from System.Data.Common.DbConnection)
    Public Method (Inherited from System.ComponentModel.Component)
    Top
    Public Events
     NameDescription
    Public Event (Inherited from System.ComponentModel.Component)
    Public EventOccurs when the state of the connection changes. (Inherited from Devart.Common.DbConnectionBase)
    Public EventOccurs when the state of the transaction is changed. (Inherited from Devart.Common.DbConnectionBase)
    Public EventOccurs when the state of the transaction is changing. (Inherited from Devart.Common.DbConnectionBase)
    Top
    Protected Events
     NameDescription
    Protected Event (Inherited from Devart.Common.DbConnectionBase)
    Top
    See Also