TEntityConnection.Connected Property

Determines whether a connection has been established.




property Connected: boolean default False;


Read the Connected property value to determine the current status of a database connection. If Connected is True, the database connection is active; if False, then the connection is inactive. Set Connected to True to open the connection. Set Connected to False to terminate the connection.

The database to which the connection is established, is specified by ProviderName and DialectName properties. The connection parameters are passed through the ConnectionString property.

Setting Connected to True generates a BeforeConnect event, establishes the connection, and generates an AfterConnect event. In addition, when setting Connected to True TEntityConnection may display a login dialog, depending on the value of LoginPrompt. Setting Connected to False generates a BeforeDisconnect event, drops the connection, and generates an AfterDisconnect event.

Also, the Connected property value is toggled when Connect and Disconnect methods are executed.

See Also

© 1997-2019 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback