Update: Now you can enter several sets of active results (MARS) for the entered connection string using the Sequelizer admin panel. This is the recommended approach since web.config no longer needs to be changed, which causes AppDomain restart at startup
You can build a connection string from the URI entered into your web.config application. This process is described here , but I also included a snippet in it:
var uriString = ConfigurationManager.AppSettings["SQLSERVER_URI"]; var uri = new Uri(uriString); var connectionString = new SqlConnectionStringBuilder { DataSource = uri.Host, InitialCatalog = uri.AbsolutePath.Trim('/'), UserID = uri.UserInfo.Split(':').First(), Password = uri.UserInfo.Split(':').Last(), MultipleActiveResultSets = true, }.ConnectionString;
Notice MultipleActiveResultSets = true .
If you also need to create a connection string other than the first code, then you need to use EntityConnectionStringBuilder for the rest, for example:
var builder = new EntityConnectionStringBuilder(); builder.ProviderConnectionString = connectionString; builder.Metadata = "somemetadata"; builder.Provider = "System.Data.SqlClient";
(also answered on the AppHarbor support forum )
source share