Skip to main content

Error: Type String Cannot be Converted to Type Nvarchar of the Specified Target Column

Symptoms

When synchronizing or executing a NAV data source, the following error message may appear.

"The given value of type String from the data source cannot be converted to type nvarchar of the specified target column."

Resolution

When using the NAV Adapter data source type, this error message has been tied to the value set for the 'Option Field Text Length' in the Navision Enhancements Settings.

  1. To change this value, right-click your NAV data source and select Enhancements > Navision Enhancements Settings as shown below:

  2. In the window that opens, adjust the 'Option Field Text Length' to a value large enough for your existing Option Field values. Click OK to continue.

    The currently supported maximum value is 4000 characters.  Please visit our support site for assistance if you have option values that exceed this.

  3. After adjusting the Option Field Text Length , you will need to synchronize the data source objects for the updated length value to be applied to the corresponding tables within your staging database.  To do so, right-click your NAV data source and select 'Synchronize Objects'.

    If the data source has not been previously synchronized, this will be displayed as ' Read Objects ' instead of ' Synchronize Objects'

  4. The last step to push these changes to your entire project is to Deploy and Execute the tables and objects that have been modified.  To do so, right-click your Project name (top-most node of your project) and select Deploy and Execute > Deploy and Execute Modified Objects

    In the ensuing window, simply click Start to begin the process.

Was this article helpful?

We're sorry to hear that.