Registering the connection string

There are two methods for registering the connection string:

  • You can register an ODBC data source in the ODBC Data Source Administrator, and reference it by name.

  • You can specify a full SQL Anywhere connection string. For example:

    connectionString="ENG=MyServer;DBN=MyDatabase;UID=DBA;PWD=sql"

When you add the <connectionStrings> element to the web.config file, the connection string and its provider can be referenced by the application. Updates can be implemented in a single location.

XML code sample for connection string registration
<connectionStrings>
   <add name="MyConnectionString" 	
      connectionString="DSN=MyDataSource" 	
      providerName="iAnywhere.Data.SQLAnywhere"/>
</connectionStrings>