Browsing 7239 questions and answers with Jon Skeet
It feels to me like you only actually want to handle three cases: Input is already the right type Strings Integers in various types I believe this will do what you want for valid input: public object ToEnum(Type enumType, object... more 1/31/2014 2:32:23 PM
You may have run into a situation where you're taking the same code path, but the results are subtly different in debug vs non-debug due to optimizations. There are a couple of distinct possibilities here: Your code has a subtle bug,... more 1/31/2014 12:45:46 PM
That's up to the process in question. Even the "0 means success" is a convention more than anything else - although it's a very common one. In general I would assume that any non-zero value is an error of some description; look at the... more 1/31/2014 12:23:01 PM
I suspect the problem is that after you've removed element i (which moves everything after it up the list - the element at index n + 1 now has index n etc) you're then skipping the next element. So if you have two consecutive elements to... more 1/30/2014 9:33:04 PM
If you don't want to write a line, don't use Console.Write*Line*. Just use Console.Write: for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { Console.Write(aField[i, j]); } ... more 1/30/2014 9:28:23 PM
EDIT: Okay, I think I misunderstood you. Basically, you need to remember the Task that you've started, and then you can just call Wait() to wait until it's finished: class LogMethodCallAttribute : OnMethodBoundaryAspect { Task task; ... more 1/30/2014 8:51:23 PM
There are at least two issues here. Firstly, you're calling BeginExecuteNonQuery - that doesn't return an integer, it returns an IAsyncResult. I strongly suspect that you don't want to be dealing with the asynchronous API at... more 1/30/2014 6:49:15 PM
No, that field declaration just declares a field. It will have a default value of null. From section 5.2 of the C# 5 specification: The following categories of variables are automatically initialized to their default values: ... more 1/30/2014 5:30:08 PM
No, you'll end up with a lot of continuations scheduled on a lot of tasks, rather than a deep stack... at least in the initial call. Note that this is only because you're using await Task.Delay(1000); ... which can reasonably be... more 1/30/2014 4:03:07 PM
I suspect you want DATEADD: select dateformat(dateadd(dd, -1, getdate()), 'yyyy-mm-dd hh:nn:ss.SSSSSS') more 1/30/2014 2:49:34 PM