SQL Server Collation / ADO.NET DataTable.Locale with different languages
        Posted  
        
            by Turro
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Turro
        
        
        
        Published on 2010-04-26T14:37:09Z
        Indexed on 
            2010/04/30
            9:57 UTC
        
        
        Read the original article
        Hit count: 335
        
Hi all,
we have WinForms app which stores data in SQL Server (2000, we are working on porting it in 2008) through ADO.NET (1.1, working on porting to 4.0). Everything works fine if I read data previsouly written in Western-European locale (E.g.: "test", "test ù"), but now we have to be able to mix Western and non-Western alphabets as well (E.g.: "test - ???" - these are just random arabic chars).
On the SQL Server side, database has been set with the Latin1_General collation, the field is a nvarchar(80). If I run a SQL SELECT statement (E.g.: "SELECT * FROM MyTable WHERE field = 'test - ???'", don't mind about the "*" or the actual names) from Query Analyzer, I get no results; the same happens if I pass the Sql statement to an ADO.NET DataAdapter to fill a DataTable. My guess is that it has something to do with collation, but I don't know how to correct this: do I have to change to collation (SQL Server) to a different one? Or do I have to set the locale on the DataAdaoter/DataTable (ADO.NET)?
Thanks in advance to anyone who will help
© Stack Overflow or respective owner