Opens the connection to datasource.
true when connection is open, otherwise false
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.
| Exception Type | Condition |
|---|---|
| InvalidOperationException | Thrown when IsOpen is true. |
| ArgumentNullException | Thrown when no command is set, or no connection for the command. |
DataConnector Class | Resco.Controls.SmartGrid Namespace