Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to explicitly set the locale for the DataTable or DataSet

Need examples for the same.
Posted

1 solution

You can just create a new CultureInfo and then set the Locale property to that CultureInfo, like this:

C#
DataTable table = new DataTable();
    // Create a new CultureInfo
    CultureInfo currentCultureInfo = new CultureInfo("en-gb");
    table.Locale = currentCultureInfo;


Hope this helps
 
Share this answer
 
Comments
Sandeep Mewara 18-May-11 4:36am    
5!
Wayne Gaylard 18-May-11 4:46am    
Many Thanks!
Kim Togo 18-May-11 5:00am    
Good answer, 5.
Wayne Gaylard 18-May-11 5:06am    
Thanks
Santosh K. Tripathi 3-Nov-15 6:24am    
i have one doubt. if in a class i am creating 10 data set, i have to set for all of them( 10 more lines of code). is there any way to set it as default for all dataset in this class.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900