Microsoft KB Archive/325681

= FIX: &quot;Cannot resolve collation conflict for column 2 in SELECT statement&quot; error message when you expand or drag a table =

Article ID: 325681

Article Last Modified on 9/15/2005

-

APPLIES TO


 * Microsoft .NET Framework 1.1 Service Pack 1
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft ADO.NET 1.1
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Academic Edition

-



This article was previously published under Q325681



SYMPTOMS
In Visual Studio .NET Server Explorer, a connection is established to a Microsoft SQL Server database. When you expand a table to view fields, or when you drag a table to the Form Designer, you may receive the following error message:

ADO error: Cannot resolve collation conflict for column 2 in SELECT statement.



CAUSE
The Visual Database Tool does not work correctly when you set the SQL Server database collation property to a collation setting that is different from the server default collation.



RESOLUTION
To work around this problem, use one of the following methods:
 * Create a new database with the collation name as &quot;(server default)&quot;. Import data from the current database, and make sure that the Copy objects and data between SQL Server databases option is selected. Connect to this new database from Server Explorer.
 * Do not use Server Explorer to drag the table to the Form Designer so that ADO.NET generates the code for you. Instead, create the SqlDataAdapter object and its UpdateCommand, DeleteCommand, and InsertCommand properties programmatically in the code.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Use SQL Server Enterprise Manager to open an instance of Microsoft SQL Server. Create a new database named TestDB, and then select any collation name other than the server default for the database. Create a table named Table1 in the TestDB database, add the following columns to Table1, and then set column &quot;c1&quot; as the primary key:

 Start Visual Studio .NET. In Server Explorer, add a new data connection to this instance of SQL Server and the TestDB database.</li> Expand the Tables and the Table1 nodes. Notice that you receive the following error message:

ADO error: Cannot resolve collation conflict for column 2 in SELECT statement.

</li> Drag Table1 to Form Designer. Notice that you receive a Data Adapter Configuration Error dialog box that includes the following error messages:

Generated INSERT statement.

ADO error: Cannot resolve collation conflict for column 2 in SELECT statement.

Generated UPDATE statement.

ADO error: Cannot resolve collation conflict for column 2 in SELECT statement.

Generated DELETE statement.

ADO error: Cannot resolve collation conflict for column 2 in SELECT statement.

</li></ol>

Keywords: kbbug kbpending kbvs2002sp1sweep KB325681

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.