Browsing 7239 questions and answers with Jon Skeet
It sounds like you probably just want: decimal price = reader.GetDecimal(reader.GetOrdinal("PRICE")); textBox7.Text = price.ToString("0.00"); Basically, decimal and int aren't the same things, and if you're storing a value as a decimal,... more 3/3/2016 1:21:01 PM
It sounds like you just want to use Elements instead of Descendants, but at the right point - it's not clear where you tried using it. I'd also recommend using ToList to make things simpler. Given the sample in the documentation, it looks... more 3/3/2016 8:41:19 AM
Okay, if I've understood you correctly, I think you probably want something like: var zone = DateTimeZoneProviders.Tzdb["America/Chicago"]; var instantStart = Instant.FromDateTimeUtc(week.BeginDate); var chicagoStart =... more 3/2/2016 3:34:13 PM
When you call TypeBuilder.DefineMethod, just include MethodAttributes.NewSlot: Indicates that the method always gets a new slot in the vtable. more 3/2/2016 1:48:14 PM
I'm not sure why you're getting the exception, but I strongly suspect it's because you're modifying the document while you're querying it. If you change your code to use a ToList() call to get the list of nodes to remove, that doesn't... more 3/2/2016 9:26:55 AM
If you mean you're trying to avoid getHeaderByteArray from being called multiple times, then yes, you're doing exactly the right thing. The "cost" of having one extra local variable is negligible in almost all cases. I'd say it's also more... more 3/2/2016 8:18:09 AM
You can see that two GregorianCalendars present different days, but finally we got a gap equals 0. Yes, and that's entirely reasonable. You're comparing March 2nd, 15:28:08 with March 3rd, 01:00:00. They're on different dates, but are... more 3/2/2016 7:58:39 AM
Next to each line I want to write the bytes in ASCII format but when I encounter 00H all the text after that is not appended to the string. Yes it is - it's just not shown in the text box. (You're also using ISO-8859-1, not ASCII.... more 3/2/2016 6:43:15 AM
Javascript uses 64-bit IEEE-754 binary floating point to store all numbers - like double in C# and Java, for example. There isn't a different type to store integers. (The actual implementation may use optimizations to avoid always... more 3/1/2016 4:11:00 PM
You need to perform the mapping yourself. For example, you could use: static async Task<Dictionary<string,string>> GetUrls(string[] urls) { var tasks = urls.Select(async url => { using (var client = new... more 3/1/2016 2:16:35 PM