|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Desktop Application Culture Settingi'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 Lucky,
> can anyone tell me how can i set culture for my application so that it This is a little bit difficult.> can always you English culture(US or UK) for Datetime and numeric data? > There is an US culture for English and there are the cultures for other countries including the UK where English is spoken. They both use the dot as decimal separator, but have an other date notation, The InvariantCulture is special made for that, but that you cannot set as culture. You can only use it in the datetimeparse and probably some other classes. Does not give much help, but if you want to make your program Country depended (the US culture is not used in Canada by instance) than you have to choice for one. Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US") Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US") I hope this helps anyway Cor Show quoteHide quote > 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 > Hi Cor,
I do understand that making an application Culture specific is not a good idea but requirement is in such a way that i have to standerdize some of the part in specific manner so that when the data comes for processing application finds it required formate. by the way, that was great help for me. i was just looking for that exact line of code. thanks, Lucky Cor Ligthert [MVP] wrote: Show quoteHide quote > Lucky, > > > 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? > > > This is a little bit difficult. > > There is an US culture for English and there are the cultures for other > countries including the UK where English is spoken. > > They both use the dot as decimal separator, but have an other date notation, > > The InvariantCulture is special made for that, but that you cannot set as > culture. You can only use it in the datetimeparse and probably some other > classes. > > Does not give much help, but if you want to make your program Country > depended (the US culture is not used in Canada by instance) than you have to > choice for one. > > Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US") > Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-US") > > I hope this helps anyway > > Cor > > > 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 > >
VB.NET Express speed issue
To overload, or not to overload? ANN: VS.NET 2003 SP1 Memory Usange In VB.NET Serial Port Communuciation in VB with Compact Framework 2.0 Capturing the second column data from a list view box. create a folder useing vb code? Automaticaly Clicking a Checkbox on a webbrowser control Control.Visble = True ERROR DateTime.ParseExact(..) |
|||||||||||||||||||||||