2,157 Posted Topics
Re: Can do it with one line Queue<String> myQueue = new Queue<String>(File.ReadAllLines(filePath + "file.txt")); | |
Re: Line 28 you dispose of the connection. You'll have to recreate it. And your latest post is no help at all. What error, what code? | |
Re: FIrst, rarely if ever, you don't put any of your code into the xxxx.Designer.cs files. You put it in the xxxx.cs file. Second, according to [this](http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx) page, the signature to use is protected virtual void Dispose(bool disposing) | |
| |
| |
Re: [This](http://forums.codeguru.com/showthread.php?415930-DataGridView-Merging-Cells&p=1537635#post1537635) thread shows merging cells horizontally, you'd just have to adapt it to vertical merging | |
Re: So what you need it to calculate the column that each button would be in, and then the row. Row is equal to i / 8 (0-7 = 0, 8-15 = 1, etc.) and Column is equal to i % 8. Use these values to calculate your Location point ( … | |
Re: Nice way to resurrect a 6 year old thread :) | |
Re: Just check if the hashtable contains the key then create a list if it doesn't if (hashtable.Contains(key) == false) { hashtable.Add(key, new List<someType>()); } | |
Re: Using a for loop is a bad practice, use a while loop int i = 0; while (i < lotto.Length) { check = rand.Next(1, 41); if (lotto.Contains(check) == false) { lotto[i] = check; i++; } } | |
Re: You can do something like this private void textBox_Leave(object sender, EventArgs e) { TextBox tb = sender as TextBox; if (tb.Text.Trim() == String.Empty) { MessageBox.Show(String.Format("Please enter something in the {0} box", tb.Tag.ToString())); tb.Focus(); } } Set the Tag property of each textbox to what you'd like to go into the … | |
Re: With C++ you have the C++ runtime, also. But there are companies that claim they can generate a stand alone executable. Use your favortie search engine. | |
Re: You can't cast a string into an int. You can **Parse**, or **Convert** a string into an int. | |
Re: You should set the column as auto and you don't have to worry about it. Other than that, we can't tell how you've defined the table, so can't tell if you have the right column, what type it is, etc. | |
Re: [TimeSpan](http://msdn.microsoft.com/en-us/library/system.timespan.aspx) ts = Date1 - Date2; That's all you need. | |
Re: What have you done so far? We'll help with your homework, but not do it for you. | |
![]() | Re: I'm going to answer these but you should have posted what you thought the answer was 21. 52 22. 10 23. int.Parse("42") 24. IF should be lowercase 25. true 26. OR 27. The answer is 5, but that isn't a choice 28. 5 29. listBox1.Items.Add("ME") (the first choice) 30. do … |
Re: Yes, you did all that work instead of just calling [URL="http://msdn.microsoft.com/en-us/library/07wt70x2.aspx"]Directory.GetFiles[/URL] | |
Re: Registering with the GAC can cause issues (in that it looks there first, rather than local and if you make changes to the DLL you have to unregister it from the GAC and reregister it). When you added the DLL to the project, where does the project think it should … | |
Re: If you are getting invalid object name, either the table isn't 'adb' or there is no 'Studentid' column. | |
Re: Assuming you are using uniqueidentifier as the type for the ID, you should read [this](http://msdn.microsoft.com/en-us/library/ms174335.aspx) page, noting in particulare (bolded part added) > Columns created with the uniqueidentifier data type store specially formatted 16-byte binary values. Unlike with identity columns, **the Database Engine does not automatically generate values for columns … | |
Re: Your main purpose will be data collection and analysis. Computers can perform many different ways of analysing the data to look for relationships than a person can do. Computers also allow you to collect a lot more measurements and measure things that may, seemingly, have nothing to do with the … | |
Re: It takes 8 bits to store a short, no matter how you decide to store it. So unless you have some way to compress the data you aren't going to be saving any space. Does the data have large groupings of the same value? | |
Re: It's been 3 years since the original poster asked this question, I doubt they are just waiting for you to respond. This is also the only post they have made and they haven't been back since. | |
Re: Line 12 starts total off with the wrong value and you should have `i` be a double to simplify the code. Also, the problem wants your answer to 3 decimals of accuracy, not the answer when it falls below 0.001. So you need to check your current value vs the … | |
Re: Not sure what you are asking here but there are 360 degrees in a circle and 60 minutes on a clock, so the angle at any given minute is equal to the minute times six. | |
Re: it will cover the whole screen, but your controls will not resize unless you make them, so it will look odd :) | |
Re: And why are you going through the reflection API, why not just instantiate the classes directly? | |
Re: What it is telling you is there isn't a txtCustomerID field in the database. Are you sure you spelled it right? | |
Re: Create a generic priority queue. Try using different data structures to hold the information and different methods of keeping priority order. Do time trials on queue data, de-queue, and random remove. | |
Re: Are you going to show us the INSERT statement or are we supposed to guess what you've done wrong? | |
Re: You can use any port you want. But some of them are currently 'reserved' for use by various applications (25 for mail, 110 for PoP, 80 for HTML, etc.) For general programming use, it is recommended that you use a port from 1024 through 49151. The Internet Assigned Number Authority … | |
Re: You are adding values, but what are you adding them to? There needs to be a SQL statement with as many placeholders as you have values to add, and it needs to come before you start adding values. In other words, you have no command text, just like it told … | |
Re: new creates objects, it doesn't 'clear records'. Can you be more descriptive of what you are trying to accomplish? | |
Re: Change line 13 to `dt = DateTime.Parse(indate[0] + "/01/"+indate[2]);`. Change line 14 to `DateTime newdate = dt.AddMonths(1).AddDays(-1); Remove line 15. ` | |
Re: Bob and Annie cross the bridge - 2 minutes Bob goes back alone - 2 minutes = 4 minutes Volodia and Dorothy cross the bridge - 10 minutes = 14 minutes Annie goes back alone - 1 minute = 15 minutes Bob and Annie cross the bridge - 2 minutes … | |
Re: Don't give users permissions they don't need. The application needs to do the insert, update, etc, but the users do not. | |
Re: Post your code | |
Re: So you are getting spaces instead of the characters you expect? You don't explain your problem very well, nor do you include any code. How can we see what you are doing wrong if you don't show us what you are doing? | |
Re: You do some odd things with loops that just make your logic more complicated. Lines 45-48 you get the digits 'in order' into the array, then in line 49 you sort the array. Who cares about the order, use the simplest method. In lines 50-53 you do some convoluted math … | |
Re: Article [here](http://www.codeproject.com/Articles/49798/Wake-the-PC-from-standby-or-hibernation) has a class for doing this. | |
Re: [QUOTE=ddanbe;1547859]Why you want to do that? Just use the Sort method of the array.[/QUOTE] One word: Homework | |
Re: Don't post to a thread that was ended 2 years ago. | |
Re: The WinForms menustrip doesn't support vertical text. You'll either have to find someone who makes such a control, or build your own. | |
Re: mcs ([link](http://mono-project.com/CSharp_Compiler)) | |
Re: You have placed the RandomNumber method inside the Main method, don't do that. Also, since you are calling the RandomNumber method without having created an object of type Program, you'll either have to create an object of type Program or change the method to be static. | |
Re: You do realize that the form will only exist for a fraction of a second as the form goes out of scope immediatly after you show it. |
The End.