Skip to main content
Published: October 12 2006, 10:16:00 AMUpdated: November 28 2020, 2:53:40 PM

I am running the SimpleSetup C# sample in the .NET SDK.
I keep getting an errors like "The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator."
What is going on here?


The SimpleSetup sample in the .NET SDK can be used to do database setup for use with the Database Sample (previously known as the Integration Database), and related samples that make use of that Database.
There are some issues with using the nText column type and the identity property for the SQLServer database that will require you to make changes.

Detailed Description

The following lists the suggested changes that can help remedy the problems.
  • Change the datatype on columns causing errors from the nText datatype to nvarchar(1024) or nvarchar(MAX). One such column that has been reported to cause errors is the ApiToken column in sdk_dbuser.

These may require some changes to the db access layer code such as AccountUserFactory.cs

  • Remove the identity property from the EnvironmentID column of the sdk_appsettings table.

The reason this can be an issue is that there are some direct SQL inserts done such as "INSERT INTO sdk_appsettings VALUES (?, ?, ?, ?, ?)" and sdk_appsettings has the EnvironmentID column set as an identity column.

  • Make all ID columns that have the identity property a primary key.

This will require changing the source code to stop doing the field-by-field comparison done by the table adapters. In the project, eBay.Service.SDK.Integration, in the DataSets folder, open the file DataAccessKits.cs in the designer. On each table adapter, right click and go thru the configuration wizard. When you get to the screen with the query displayed, click on the advanced button. Uncheck the boxes for "Use optimistic concurrency" and "Refresh the dataset". Finish the wizard and do that for each adapter. Please remember to rebuild the solution and use the new assembly in your projects.

All of these suggested changes will likely require changes to the source code.
If you do plan on using the Database sample(s), we strongly suggest that you take the time to get familiar with the complete source code of the eBay.Service.SDK.Integration project (DatabaseSample project).

Additional Resources

How well did this answer your question?
Answers others found helpful