948 Posted Topics
Re: Yes, that's how it's supposd to work :) Why would you not want to do that? When you destroy an object, it's not supposed to be used anymore. | |
Re: As usually is the case with this kind of question...It depends. I think the only good case nowadays (what with filestorage being quick and cheap) is when you need to control and maintain links to image metadata. Doing this in a database is much easier and provides a little redundancy … | |
![]() | Re: Please start your own thread. This question is marked solved and is over two years old. A new thread is more likely to be read and an answer to your question given. |
Re: `if(Convert.ToBoolean(dataGridView1.Rows[i].Cells["chkcol"].Value = true))` This statement will always return true as you are setting the Value to true in your statement. Was this was your intended result? | |
Hiya, I've just tried updating my profile with better information, however it fails to validate my MSN address and Twitter account. As a note, I hadn't actually updated these values, they were already in the system.  | |
Re: What do you mean by "line spaces"? It could mean a couple of things in this context, could you clarify please? :) | |
Re: Is there anything missing from the form that you haven't posted? That doesn't particularly look like it does anything. Have you tried just calling the action in the browser with no parameters to see what happens? | |
Re: > Cue everyone telling you to use std::string instead of C-style strings. Or at least, `snprintf` ;) (If you are using the 2011 standards compiler) | |
Re: Strictly speaking you should put it in a `using` statement too :) | |
Re: Honestly, that isn't very much and looks like boiler-plate code. Logically speaking, how to do your assignment is explained quite well in the assignment question, it even goes so far as to tell you what each method should do. I think I should re-iterate deceptikon's question, could you please be … | |
Re: My first suggestion is to try and subsection your code a little. Your code is complex and a bit difficult to read. If you split it out, it will be easier to understand. Secondly, your logic fails when `a` and `b` are of equal length when `b` is larger than … | |
Re: You will need to scrape the website for the Anti-CSRF token that is attached to the form and make the request as though you are a user, not a program that is using an API. If you search the forum for "FakeWebClient" you will find some code that will be … | |
Re: The only difference is how they behave if a session doesn't exist. `Session` will throw an exception if the session doesn't exists, whereas `HttpContext.Current.Session` will return null. If a session exists, they will both point to the same reference. | |
Re: You need to use `in (val1, val2, ...)` be warned that this can be a farely slow operation, it's complicated to parameterise and only available in SQL 200 and above. | |
Re: You need to drop your `DISTINCT` keyword. Your Code column should be marked as Unique in the database, preventing duplicate entries. After that, simply add `[Description]` to your select statement. If you continue to use `DISTINCT` then you may end up losing data if you enter duplicates (it will only … | |
Re: I think it's akin to a `ListView`, but there is no automatic "explorer" control you can use out of the box. | |
Re: Think of it in English first. What you need to do is: Select Event -> Get Sub events for this event -> Populate Sub Event -> Get Possible co-ordinators -> Populate Coordinators -> Get Price Info (store) Select Co-oridnators Enter Participant -> Calculate Price and Display This might translate into … | |
Re: You aren't invoking, you're just adding an event handler. You can call the method directly from the Tick event: if(this.InvokeRequired) this.Invoke(new paintEventHandler(Form1_After1s), new { sender, e }); | |
Re: There should be a hand gesture for click. It would be incredibly annoying if you only hovered it, especially accidentally, and then got stuck in a menu cycle of open and close because the detection wasn't working properly... | |
Re: The built in mechanism actually uses the country codes to select the correct resource file, with the default one having no country code. If you don't want to rely on built in (which doesn't always work) [This](http://geekswithblogs.net/shaunxu/archive/2010/05/06/localization-in-asp.net-mvc-ndash-3-days-investigation-1-day.aspx) is probably the best resource on the subject. Along with the [official resource … | |
Re: You can connect directly to the Exchange server using a service but you would need to know the user's account details to either A) Impersonate the user at the app level, B) Log the service on as a particular user and use Domain Authentication. | |
Re: Can you post your app.config file contents please. This hints that the connection string isn't in your config file. | |
Re: Are you trying to call a managed library or a native library? | |
Re: For a brick that has reached the bottom, I'm presuming that the fall speed is 0? On that presumption; You enter your if statement on line 145. When you iterate your `for` loop, `spaceEmpty` will be set to false (because your block now occupies the space). This will cause you … | |
Re: `string someNumberAsString = dReader.GetInt32(dReader.GetOrdinal("Code")).ToString();` is perfectly acceptable. | |
Re: [Sql Connection Strings](http://www.connectionstrings.com/sql-server/) | |
Re: If at any point the code can be executed in the same **synchronisation context** as another thread (which may be a background thread) then you need to lock. Otherwise, don't bother. A sychronisation context (not to be confused with the object `SyncronizationContext`) could be best described as sections of code … | |
Re: Your if statements mean that no code will ever execute. `if(boolTest != true && boolTest != false)` <-- This means "boolTest must be false AND boolTest must true" this is an impossible condition as they are mutually exclusive. The same applies with your `stringTest` object the only difference being that … | |
Re: Well, all that does is write out: `The folowing numbers:` You also have a brace the wrong way around at the end of the file, you never call your Max method and it will return after one iteration of the loop. Additionally, `v` is set to 1 and never changes, … | |
Re: The foreach loop is unecessary, take it out and it should work. | |
Re: It might be better to use XML... <StyleSettings> <control name="text1"> <font size="12">Consolas</font> <forecolour>Red</forecolour> <backcolour>Yellow</backcolour> </control> <control name="text2"> <font size="11">Arial</font> </control> </StyleSettings> This is also much more readable :) You could also make sub-children: <control name="text1"> <font> <size>12</size> <name>Consolas</name> </font> </control> But this depends on your personal style. I prefer a … | |
Re: `SpinWait(numberOfIterations);` Spinwait is horrible and it should never be used. Even Microsoft say it's not useful for ordinary applications. If you're going to use SpinWait, don't even bother waiting at all. You may as well just iterate your loop repeatedly until you get the result you want. | |
Re: You only need to spawn the background thread once (your while loop will keep it running). I realise this is what your code actually does (thanks to the if statement) but you can tidy that up into a dedicated initialisation method. The button click event should only call Set on … | |
Re: The form has a `Width` and `Height` property. Change these appropriately. | |
Re: As a simple explanation; it requests that the code you provide is executed on the thread that created the controls owner. This is typically the UI thread. | |
Re: Just thought I'd throw my 2p in. Be careful with lazy evaluation, you can easily cripple performance by re-iterating queries you already executed. IEnumerable<int> query = myIntList.Where(i => i > 0); long result = 0; // Executes Query foreach(int i in query) { result += query; } // Executes Query … | |
Re: Are you using WebAPI or WCF? URI Parameters is a strange way to call WCF (typically you'd use a SOAP object)... | |
Re: Thread.Sleep will *not* use CPU. It puts the thread to sleep so that it doesn't. What you effectively have there is a spin. Additionally, the resolution of the timer used for Thread.Sleep cannot guarantee you will recieve a 1ms sleep. A time slice is aproximately 15.6ms so at most, you … | |
Re: Try checking what process has your file locked with [Process Explorer](http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) Can't see anything obvious that would open a file and lock it in your code. | |
Re: Whoever imposed the 70mph limit needs to be taken out and shot! ;) On a more serious note, speaking as a Brit, knowing how tightly guns are controlled I feel safer here than I do when I visit the states. I'm still afraid of Mr. Burberry and his chavtastic warriors, … | |
Re: Just because a company is new, it doesn't mean you should avoid them. Evaluate them against what they offer vs the price vs what you can get from other companies. If it does what you want and is in your budget, buy it using a credit card that offers you … | |
Re: Don't really need to use Regex, String.Replace will work fine :) `string newString = "Deleting 11 files.ABC: Total Time = 01:16:30, Remaining Time = 00:00:00".Replace(' ', ',').Replace('.', ',');` Using regex does look tidier although the one listed above is incorrect. It should be: `string newString = Regex.Replace("Deleting 11 files.ABC: Total … | |
Seems like there might be a problem with the editor not recognising code insertion when you're pasting code in the middle of a list. Below is a post displaying the problem http://www.daniweb.com/software-development/csharp/threads/458671/c-mysql-display#post1993030 I tried multiple ways to get that in there including: 1. Single Enter + Tab 2. Double Enter … | |
Re: Try deleting your HOSTS file. | |
Re: It's probably easier to explain with an example; public class BaseClass { public virtual void PrintName() { Console.WriteLine("Base"); } } public class NewDerived : BaseClass { public new void PrintName() { Console.WriteLine("New"); } } public class OverrideDerived : BaseClass { public override void PrintName() { Console.WriteLine("Derived"); } } ... BaseClass … | |
Re: Well, you aren't going to get code without doing any of your own work. But to assist in you getting started; 1. Create your Pilot table. Remember to include a primary key, using the name or callsign is not a good idea, it needs to be something the database can … | |
Re: Animé are generally not children's cartoons. Some are targetted for that age group and some are not. The same applies for some Western cartoons. Would you let a young child watch Family Guy or American Dad for example? Some animé are definitely targetted at adults too, maybe young adult but … | |
The End.