Firebird Tutorial for .NET 2.0

Storing connection string in web.config

If you store the connection string in the web.config file in the connectionStrings section you can access it easily from both the page code and source.

<configuration>
  ...
  <connectionStrings>
    <add
      name="mydb"
      connectionString="Server=localhost;User=SYSDBA;Password=masterkey;Charser=NONE;Database=c:\data\mydb.fdb"
      providerName="FirebirdSql.Data.FirebirdClient"/>
  </connectionStrings>
  ...
</configuration>

In the code

ConfigurationManager.ConnectionStrings["mydb"].ConnectionString

In the page source

<%$ ConnectionStrings:mydb %>