Skip to main content
insightsoftware Docs insightsoftware Docs
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

Error: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception

Issue

When user a 'Dynamics NAV 2013 and later (SQL Server)' data source in the Jet Excel Add-In, a non-admin user can receive the following error:

error_msg.png

Complete text of error message is:

An unexpected error has occurred: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

Cause

Non-admin user accounts need to be assigned to the "Impersonate a client after authentication" security policy role to allow the Jet Excel Add-In to access data directly from a SQL database.

Resolution

Here are the steps that a LOCAL ADMINISTRATOR will need to follow to add the non-admin user to this role:

  1. From the Windows Start menu, search for Administrative Tools and click Administrative Tools.
  2. Double-click Local Security Policy
  3. Expand Local Policies , and then click User Rights Assignment
  4. In the right pane, double-click Impersonate a client after authentication
  5. In the Local Security Policy Setting dialog box, click Add User or Group
  6. In the Select Users or Group dialog box, find the user account that you want to add, then click OK
  7. Click OK on the Local Security Policy Setting dialog box
  8. Reboot the system and try the steps to reproduce the problem

Published:

Error: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception

Issue

When user a 'Dynamics NAV 2013 and later (SQL Server)' data source in the Jet Excel Add-In, a non-admin user can receive the following error:

error_msg.png

Complete text of error message is:

An unexpected error has occurred: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

Cause

Non-admin user accounts need to be assigned to the "Impersonate a client after authentication" security policy role to allow the Jet Excel Add-In to access data directly from a SQL database.

Resolution

Here are the steps that a LOCAL ADMINISTRATOR will need to follow to add the non-admin user to this role:

  1. From the Windows Start menu, search for Administrative Tools and click Administrative Tools.
  2. Double-click Local Security Policy
  3. Expand Local Policies , and then click User Rights Assignment
  4. In the right pane, double-click Impersonate a client after authentication
  5. In the Local Security Policy Setting dialog box, click Add User or Group
  6. In the Select Users or Group dialog box, find the user account that you want to add, then click OK
  7. Click OK on the Local Security Policy Setting dialog box
  8. Reboot the system and try the steps to reproduce the problem

For an optimal Community experience, Please view on Desktop