ODataDB Web.config Configuration Tips

ODataDB Web.config Configuration Tips

ODataDB reads configuration from web.config files.

There are two main sections:

  • connectionStrings
  • and DbProviderFactories.

Connection Strings

Here is an example of the connectionStrings section:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="AzureDemo50" connectionString="Provider=SQLOLEDB;Data Source=.\SQLEXPRESS;Initial Catalog=AzureDemo50;Integrated Security=SSPI"
      providerName="System.Data.OleDb" />
    <add name="NorthwindCE" connectionString="Data Source=~\App-Data\Northwind.sdf"
      providerName="System.Data.SqlServerCe.4.0" />
  </connectionStrings>
</configuration>

Accordingly, ODataDB publishes databases via URLs like:

  • http://localhost:40440/odatadb.svc/v4/AzureDemo50/default/
  • http://localhost:40440/odatadb.svc/v4/NorthwindCE/default/

You may edit connection strings in visual mode using gConnectionManager.

Important! Create connection strings with integrated security or erase real passwords after creating connection strings.

DbProviderFactories

The web.config files can also contain database provider configurations if the providers are located in the bin subdirectory.

For example, ODataDB includes the MySQL .NET provider that is specified in the DbProviderFactories section:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient"/>
      <add name="MySQL Data Provider"
          invariant="MySql.Data.MySqlClient"
          description=".Net Framework Data Provider for MySQL"
          type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
</configuration>

By default, ODataDB includes .NET database providers for:

  • Microsoft SQL Server
  • Microsoft SQL Server Compact
  • Oracle Database
  • MySQL
  • PostgreSQL
  • NuoDB

 

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.