You searched for how does c# work
. We found 81
results in 0.231 seconds.
As the error message is saying, you need to pass the type of the enum as the first argument. You also need to change the type of myValue to match the out parameter of EnumTryParse, so: object myValue; if... more
You're not really making a constructor call in the normal way, even though that's what it looks like. Instead, this is a delegate-creation-expression as described in the C# 5 specification, section 7.6.10.5: A... more
Is there a way to guarantee at build time that a class matches the interface parameter names? I would prefer not to do this manually. Not within the C# language. However: You could write a unit test to check, reasonably easily. Not... more
It sounds like you should be returning the list reference, rather than using it as a parameter - otherwise the fact that you're assigning a different value to it in the first statement of the method body makes it pointless: private... more
No, you don't need to create an IFormatProvider at all. The invariant culture is fine for this (assuming the month name is always in English). You can just use DateTime.ParseExact, passing in the appropriate custom format string (quoting... more
You basically don't need to do anything except stop thinking about bytes as numbers. Think of them as 8 bits, and Java and C# are identical. It's rare that you really want to consider a byte as a magnitude - it's usually just binary data... more
You're calling Replace but not doing anything with the result - strings are immutable in C#, so the Replace method doesn't change the contents of the existing string. As the documentation states: This method does not modify the value... more
If you only need to support a very specific set of types that are supported by it, then Convert.ChangeType may be okay: object value = (string) ds.Tables[0].Rows[0]["MyVarcharColumn"]; return (T) Convert.ChangeType(value,... more
Well this is probably the first problem: InputStreamReader reader1 = new InputStreamReader(in); That's loading the file using the platform default encoding, which may or may not be appropriate for the file in question. Likewise... more
I think you're confused about what your methods are doing, and when you're initializing objects. I suspect you actually want to do something like this: class Program { static void Main(string[] args) { // Ask the user for... more