Browsing 7239 questions and answers with Jon Skeet
Don't fix the exception - stop constructing SQL like this to start with. (The exception is due to a typo as Pheonyx suggested, but don't just fix that.) Instead, use parameterized SQL, and specify the values as parameter values.... more 2/17/2015 2:40:52 PM
All the LINQ methods are extension methods. The compiler only knows which extension methods you're interested based on which using directives are present in your code, e.g. // Imports extension methods from all static classes in the //... more 2/17/2015 2:25:14 PM
These lines: var diff = DateTime.Parse(TextBox2.Text.ToString()).Subtract(DateTime.Parse(TextBox1.Text.ToString())); cmd.Parameters.AddWithValue("@NumOfDays", diff); set the value of the @NumOfDays parameter to a TimeSpan. Firstly,... more 2/17/2015 11:29:55 AM
It doesn't make sense to use a and b as indexes into an array - they are themselves String[] variables - check the declaration. If you're trying to iterate over every element in the array, I suspect you want: for(String[] a : St) { ... more 2/16/2015 3:30:09 PM
The execution-time type is part of the data of the object itself. It's almost like it's a hidden read-only field in System.Object, and GetType() just returns the value of that field. (It's not quite that simple, but that's a reasonable... more 2/16/2015 3:06:24 PM
The problem is with how you're specifying the classpath. You just need to specify the directory which is at the root of the directory containing the classes, so if you've got com/GetData.class you just need: javac -cp .... more 2/16/2015 2:44:30 PM
The problem is that you're sleeping on the UI thread, which means the UI can't update. Instead, you should use a timer, e.g. a DispatcherTimer to call a method repeatedly (until it's finished). Alternatively, make your method async and... more 2/16/2015 12:41:46 PM
mkdir isn't a standalone executable you can launch as a separate process - it's a command that the Windows command shell understands. So you could run cmd.exe /c mkdir ...: Runtime.getRuntime().exec("cmd.exe /c mkdir... more 2/16/2015 9:14:43 AM
Well, firstly you'd need multiple tasks in your XML file, e.g. <Tasks> <Task> ... </Task> <Task> ... </Task> </Tasks> Then you could iterate over all the tasks like... more 2/15/2015 2:48:37 PM
Overload resolution is performed at compile-time, and in JustAMethod it's performed once, not once per type-argument. So primaryModelCopy.ShallowCopy is resolved to the Search.ShallowCopy method. There are two options here: You could... more 2/15/2015 10:43:51 AM