Condividi tramite


Import Organization problems - ExecuteNonQuery requires an open and available Connection. The connection's current state is closed

The Import organization process is failing with the following error message:

Platform Error

=====================================

19:03:33| Error| Import Organization (Name=<OrgName>, Id=<OrgID>) failed with Exception:
System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String method, SqlCommand command)
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
at Microsoft.Crm.CrmDbConnection.SetTransactionIsolationLevel(IsolationLevel il)
at Microsoft.Crm.CrmDbConnection.Dispose(Boolean disposing)
at Microsoft.Crm.SqlExecutionContext.Dispose(Boolean disposing)
at Microsoft.Crm.SqlExecutionContext.Dispose()
at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)

This is likely caused by a Microsoft.Net Framework 2.0 issue.  If your System.data.ni.dll file is less than 2.0.50727.1813, then you need to update the Microsoft.Net Framework version on at least your Microsoft CRM server and also your Microsoft SQL Server.  You can get the update in KB article, https://support.microsoft.com/kb/948815 .  The problem is described in the KB article, https://support.microsoft.com/kb/948868 .

Jibran Ali
CRM Support Escalation Engineer