Browsing 7239 questions and answers with Jon Skeet
You're starting with a line break - you shouldn't. Basically, change this: string header = "\r\n"; header += "HTTP/1.1 200 OK\r\n"; to string header = "HTTP/1.1 200 OK\r\n"; more 6/6/2015 2:11:57 PM
The problem is that you're opening the output file on every iteration. Instead, you should have both files open at the same time: using (var reader = File.OpenText(@"c:\test.txt")) { using (var writer =... more 6/6/2015 1:13:06 PM
I want to know if there is any way to get data from string without knowing the data string pattern. Without any more information, this is very error prone. For example, consider "7/6/2015" - does that mean June 7th, or July 6th? If... more 6/6/2015 12:52:07 PM
The issue is that when you use ElementAt(0), it only needs to find the first element - so if there's an ID element later with an invalid value (which I'm sure there is), you're not going to hit it. When you call Count() or ToList(), it... more 6/5/2015 3:51:23 PM
SQL parameters are generally only valid for values (e.g. the values of fields) - not field names and table names etc. While it's annoying, you'll probably need to embed these names directly into the SQL. You should be very careful doing... more 6/5/2015 3:46:44 PM
You can only assign to a final field within a constructor body (or as part of the declaration, or an instance initializer). So basically, you should ditch your setSuit and setRank methods. public Card(String cardRank, String cardSuit) { ... more 6/5/2015 2:12:23 PM
The problem is this line: s = File.Create(path) That doesn't do what you want it to. That's creating a new stream - at which point you're ignoring the old one entirely. You probably want something like: using (var output =... more 6/5/2015 2:09:49 PM
But p already is Object (if you do "p is Object" you will get true). That doesn't mean the value of p is already a reference. From the C# spec 7.10.10, the is operator - just the relevant part, where D is Point here, and T is... more 6/5/2015 1:03:02 PM
I strongly suspect the problem is that your start and end date values are the exact same point in time - so only values at that exact point in time will be found. For example, suppose you have: searchStartDate:... more 6/5/2015 8:42:35 AM
Yes, this is due to the associativity of +. This: String start= number+number+" "+number+number; is effectively: String start = (((number + number) + " ") + number) + number; So you're getting number + number (which is performing... more 6/5/2015 8:38:34 AM