Browsing 7239 questions and answers with Jon Skeet
You're calling record.GetString, and I'd expect that to fail, because that's trying to perform the conversion to a string. You should be able to see that in the stack trace. Instead, use record.GetValue: string foo =... more 8/11/2015 9:18:34 AM
There are two options that can help you here: Parallel LINQ TPL Dataflow Parallel LINQ is the simpler option, but provides a lot less customization. It would look something like: var results = File.ReadLines("input.csv") ... more 8/11/2015 7:16:28 AM
Will the ordering of the keys be consistent with the ordering of the values? Yes, it's guaranteed by the documentation of both IDictionary<,>.Keys and IDictionary<,>.Values. Keys documentation: The order of the keys... more 8/10/2015 5:24:08 PM
An indexer is really just a property with an extra parameter, so you want: var property = Expression.Property(ctxExpr, proInfo); var indexed = Expression.Property(property, "Item", Expression.Constant(0)); where "Item" is the name of... more 8/10/2015 4:48:52 PM
Currently you're specifying the raw type when you specify the method reference - in the first case generic type inference with the assignment tells the compiler what you mean, but that doesn't work for the target of a method call. You can... more 8/10/2015 1:20:47 PM
It's working as intended and as documented. From the documentation: Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit. For positive BigIntegers, this is equivalent to... more 8/10/2015 11:36:25 AM
It's explicitly implemented, as shown in the documentation, as is IEnumerator.Current. In other words, you can only call the method on a value with a compile-time type of IEnumerator. So you could use: // Casing changed to be more... more 8/10/2015 8:49:41 AM
As noted, the value is an instance of DbNull. Given that DbNull.Value is a singleton (and thus safe for reference comparisons), two options come to mind: if (myDataGridView.Rows[0].Cells[1].Value == DBNull.Value) or if... more 8/10/2015 6:17:49 AM
Just send (byte) 0xa0. Yes, as a Java byte it will be negative, but it will still have the right bit pattern, which is all the RFID will care about. Basically, you rarely need to think of bytes as numbers as such - it's more usual to... more 8/9/2015 7:07:27 PM
The classpath is meant to include the root of the package structure for any appropriate directory. So the compiler is currently looking for ../../colorCalculator/Model.class or ./colorCalculator/colorCalculator/Model.class when you... more 8/9/2015 5:53:47 PM