Inheritors may override this read-only property with a default connection string suitable for their own .NET Data Provider. The Connection property calls the subclass' implementation of CreateConnection and passes the connection string specified here when a connection is first initialized.
Connection strings can contain sensitive logon credentials for accessing database resources, therefore developers must exercise caution in securing the places in which connection strings can appear in their code. While a default connection is offered for convenience, frequently it is more secure to assign an IDbConnection component (such as an OleDbConnection) directly to the Connection property in Page_Load. In this manner, application code can create a connection string with the necessary logon credentials at the last moment, drawn from a securable source such as the web.config file or LSA.
Inheritors providing a default connection string may make use of the FilterConnectionString method to achieve a similar effect. FilterConnectionString is called before the default connection string is used, and can add logon credentials at the last moment to the connection string. An overridden implementation of FilterConnectionString may obtain those logon credentials from a secured resource.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2