I've looked around this forum, and the rest of the internet, but my code is not working. Here is the problem: I read XML files that are in en-US culture. The decimal separator is a dot ".". Given the string "123.45", I want to convert the separator from a dot, to a comma. The current code doesn't work. [CODE] String tmp = "123.45"; System.Globalization.CultureInfo myInfo = System.Globalization.CultureInfo.CurrentUICulture; /****The above line returns my culture, es-ES where the number separator is ","***/ System.Windows.Forms.MessageBox.Show("New value: "+ Decimal.Parse(test, myInfo)); /***The above line displays the result "12345"***/ [/CODE] I have a lot of variables to …

Member Avatar
Member Avatar
+0 forum 5

Ok so I'm a total noob with VB.NET and I so far I've read about a thousand forums and I've yet to get a straight answer. I've read that VB treats anonymous types differently than C# (the why, beats me). I have a DataTable, and I want to return a NEW Table with the **duplicate entries** (of columns 4 and 5) from the first one. For ex: T1 looks like this: [COL4][COL5][COL6]...[COLN] 1 1 1 2 1 1 1 3 1 3 The Output Table should be like this: [COL4] [COL5] 1 1 1 3 So far I've got this: …

Member Avatar
Member Avatar
+0 forum 3

Greetings. In my Console Application, I have a process that connects to a Access Database File. After closing the connection I copy the file to another folder, and delete the original. Lately this is failing a lot. For some reason the File is still being used, even if the connection is closed. I think that the problem is the speed at which it's doing everything, I try to delete it right after the closeConnection() method. And the connection might not be fully closed??? This is something that I don't fully understand yet. Anyways, I wanted to add a small timer …

Member Avatar
Member Avatar
+0 forum 9

Greetings. Ok so my problem is that I get a "Currency" formatted value from the database and this value sometimes comes as a whole number (without decimals) and sometimes it doesn't. But, when I output the information as "string" into an XML File, I [B][I]always need to show the 2 decimal places even if they are zero. [/I][/B] I tried with the following code: [CODE]price = string.Format("{0:N2", decimalPrice);[/CODE] This works if e.g: the variable decimalPrice has a value of 59.33 However if it has a value of 59 this will not work, and will throw a format exception. Any suggestions? …

Member Avatar
Member Avatar
+0 forum 1

The End.