none
Best practices for globalization and collation RRS feed

  • Question

  • I'm trying to find the best way to implement a globalization feature where the user can change sort order of a table depending on the language of UI. Note that the application has SQL backend, which its collation cannot be changed on the fly. The data used in the application can be very large (>8000 records) so we cache x number of records instead of loading everything into the memory. Then it is displayed in DataGrid in a Form. Could someone give me a recommendation? The application is written in C#.
    Friday, July 16, 2010 6:02 PM

All replies

  • Greetings,

    You can use of xml file for global serialization .You need to have a good database deisgn, if the database is good , any thing can work. You need to analyse very things before you come with a database design.

     

    Good luck

     

    Regards,

    Phijo

     


    Helping People To Solve Technical Problems
    Saturday, July 17, 2010 3:20 PM
  • So let me clarify. Are you saying that I extract data from SQL Server database in XML format, parse it in C#, and then bind it to DataGrid? Maybe I am not seeing what you are seeing but it seems like it would consume a lot of memory. How do you approach the issue of large number of records?

    Perhaps we should talk about a specific example.

    Suppose a table A has 8000 records, and its database's collation is set to English but the culture of UI in that application connects to is in French. Are you suggesting that:

    1. Query data from the table in SQL database using FOR XML .... statement

    2. Parse the data in the application's C# data access layer

    3. Bind the data to DataTable, set its Locale property to French

    4. Bind it to DataGrid

     

    Monday, July 19, 2010 5:27 PM
  •  Note that the application has SQL backend, which its collation cannot be changed on the fly.


    Please check out BOL on 'Collate' clause. This enables you to change the collation of a column from results - without affecting actual data.

    Hope this help you.

    Tuesday, July 27, 2010 6:43 AM
  • 1. Query data from the table in SQL database. <you may use the collate clause there but you would need locale information> notice that collate does not affect date or numeric TSQL types.

    2. On the C# code, set the Thread.CurrentThread.CurrentCulture to a CultureInfo object created for the locale "fr"

    Thread.CurrentThread.CurrentCulture= new CultureInfo("fr");

    or

    Thread.CurrentThread.CurrentCulture= new CultureInfo("fr-FR"); // use the specific culture if you are looking to localize for a region (specific vs neutral culture) It will affect the way the DateTime data is displayed.

     

    (as far as i remember, DataSet and DataTable are locale aware)

    3. Bind it to DataGrid
    Liz
    • Proposed as answer by Lizet Thursday, July 29, 2010 9:42 PM
    Thursday, July 29, 2010 9:40 PM