Desktop Application Culture Setting

  • Thread starter Thread starter Lucky
  • Start date Start date
L

Lucky

hi guys!
i've got one interesting problem.

one of my utility is generating data machine specific, i mean the data
is generated in the culture that the machine has.
my problem is with the numerical data, especially with double values.
the numeric data fetched from the database and saved on the machine is
in non english culture.
i want data in only english culture but i dont know how to set it.

The application is Windows Desktop Application.

can anyone tell me how can i set culture for my application so that it
can always you english culture(US or UK) for Datetime and numeric data?

Tools
c#.net 2005 (VS.NET 2.0)
ms sql server 2000

thanks,
Lucky
 
Hello Lucky,

While fetching the data from your machine, you can set the current culture
of the application specific to english.
e.g.
System.Threading.Thread.CurrentThread.CurrentCulture =
System.Globalization.CultureInfo.GetCultureInfo("de-DE");

One the data retrieval is done, you can set back the current culture of the
application specific to the local culture.
e.g.
System.Threading.Thread.CurrentThread.CurrentCulture =
System.Globalization.CultureInfo.CurrentCulture;

Hope it works for you,

Jay Kudecha.
 
Back
Top