MobileForms Toolkit Documentation

DataConnector.Open Method 

Opens the connection to datasource.

public bool Open();

Return Value

true when connection is open, otherwise false

Implements

IDataConnector.Open

Remarks

When the connection is open, position is set before the first possible row of data.

When IDbConnector.Command.Connection.State is ConnectionState.Open, the current open connection is reused. It will stay open after calling the Close method. Otherwise new connection to database is made, which is then closed by the Close method.

State of DataConnector is not the same as the state of the Command.Connection. When Command.Connection was open when calling Open method, it will stay open after calling the Close method. Otherwise the Command.Connection will be open/closed with the connector.

Note   It is required to call the Close method on the successfully opened connection.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThrown when IsOpen is true.
ArgumentNullExceptionThrown when no command is set, or no connection for the command.

See Also

DataConnector Class | Resco.Controls.SmartGrid Namespace