Browsing 7239 questions and answers with Jon Skeet
Specify a format string when performing the conversion. Don't Convert.ToString, which doesn't allow for different format strings - call ToString on the DateTime. For example: DateTime updated =... more 1/7/2014 12:37:53 PM
Ideally, you should pay for a real SSL certificate (trusted by one of the common root certificate authorities), rather than getting a self-signed one. Then there won't be any need to important any certificates. The point about losing... more 1/7/2014 12:08:24 PM
You can only await an async method. That's not true. You can await anything that follows the "awaitable pattern" (something with a GetAwaiter() method, the return type of which has appropriate IsCompleted, GetResult(), and... more 1/7/2014 5:11:14 AM
MM is "month of year", not "minute". You also want "s" (for seconds) rather than "S" (for fractions of a second). I suspect you want a format of HH:mm:ss. See the "date formatters" documentation for more inforamtion - in particular, UTS... more 1/7/2014 5:07:40 AM
The alternation is a bit of a pain. Personally I'd just do it longhand: var dictionary = new Dictionary<string, string>(); for (int index = 0; index < list.Count; index += 2) { dictionary[list[index]] = list[index +... more 1/7/2014 2:41:37 AM
I won't answer for the actual terminology used, but the guts to understand is that LINQ to Objects is effectively implemented using iterator blocks (whether or not that's the actual implementation is somewhat irrelevant). So for example,... more 1/7/2014 2:02:31 AM
Well you could use: // Alternatively use a HashSet<char> string acceptableCharacters = " 1234..."; string clean = new string(incomingText.Select(c => acceptableCharacters.Contains(c) ? ... more 1/7/2014 1:52:27 AM
Hmm. It's not the error message I'd have expected, but I suspect the problem may be related to the fact that you're referring to i within the lambda expression - and that's a variable which doesn't exist. That may be causing the compiler... more 1/7/2014 1:46:48 AM
Just use the indexer taking a string parameter: object value = row["ColumnName"]; EDIT: Assuming the value has been fetched in an appropriate type, I'd normally just cast to the CLR type you want: int someIntegerValue = (int)... more 1/7/2014 1:27:22 AM
I suspect you can just change it to: public Task PingAsync() { return Task.Factory.FromAsync(client.BeginPing, client.EndPing, new object()); } There's no benefit in making this an async method - you're just trying to create a task... more 1/6/2014 9:09:07 AM