2,157 Posted Topics
Re: Think carefully before calling Load, LoadFrom, or LoadFile: these methods [B]permanently[/B] load an assembly into the current application domain—even if you do nothing with the resultant Assembly object. Loading an assembly has side effects: it locks the assembly files as well as affecting subsequent type resolution. The only way to … | |
Re: [code]IEnumberable<IPeople> GetPeopleForCourse(int courseID) { foreach(IPeople person in GetAllPeople) { if (person is Student) { // this might not work, but then again it might. Let me know as I'm not able to test here :) if (((Student)person).CourseID == courseID) { yield return person; } } } }[/code] Again, errors in … | |
Re: That's not adding a reference. In Visual Studio, right click on the line that says "References" in the solution explorer (usually on the right side of the screen) and add a reference to System.Web (can be found in the first tab). | |
Re: I would have Booking be the base. A Booking has a Booker (link to guest) A Booking has 1 or more Rooms A Room has 1 or more Guests (which might not include the Booker from above). You would use intermediate tables to represent the relationship between a particular booking … | |
Re: [code]IEnumerable<IPeople> GetAllPeople() { foreach (IPeople person in GetAllTeachers()) { yield return person; } foreach (IPeople person in GetAllStudents()) { yield return person; } }[/code] You'll have to fix the errors because I don't know what the classes are that contain GetAllXXX() methods. | |
Re: 1) Whether or not you explicitly declare a namespace in a C# source file, the compiler adds a default namespace. This unnamed namespace, sometimes called the global namespace, is present in every file. 2) Does not matter. 3) It's a requirement that 'static' be there. If some tutorial left it … | |
Re: ToArray() attempts to cast all the objects into the type specified (the typeof part). It then returns a generic Array type. If you don't want to use the Array type, you have to cast it into the type you want (the string[] part). | |
Re: From the documentation "The DbCommandBuilder must execute the SelectCommand in order to return the metadata necessary to construct the INSERT, UPDATE, and DELETE SQL commands. As a result, an extra trip to the data source is necessary, and this can hinder performance. To achieve optimal performance, specify your commands explicitly … | |
Re: Yep, it's very easy to do so. As you said, you'll just have to install the software on any computer that needs to access the database. | |
Re: or you could just cast it [icode](int)valueToBeConverted[/icode] | |
Re: You need to install SQLExpress on the machine. It runs as a service when needed, thus the '... due to a failure in starting the process ...' | |
Re: [code]textBox1.Text = "\"" + myStringVariable + "\""; textBox1.Text = String.Format("\"{0}\"", someVariable); char quote = '"'; textBox1.Text = quote + myStringVariable + quote;[/code] | |
Re: Because the chunk data size takes up 4 bytes. 4 for "RIFF" + 4 for the data size = 8 | |
Re: Can you point out documentation on the "like" function in PHP? Need to know what it does before I can tell you if it already exists. | |
Re: [code]double height_in_feet = 48/12;[/code]This is integer division. What this means is if there is a remainder, it's lost, and then the value is converted to a double. In this case, there isn't a remainder so you have no issue. But what if you put in 45? [code]double height_in_feet = 45/12;[/code]This … | |
Re: are the () required? Can they enter zero digits? Does the letter have to be upper case? | |
Re: in your original code you open the encrypted file with two different handlers. One of which reads the key and IV values. The other then attempts to decrypt the *entire* file including the key and IV values. This won't work. Your encrypting code doesn't even write the key and IV … | |
Re: Pet peeve:[code]private long phoneNum;[/code]A phone number is *not a number*. You do not add, subtract, multiply, divide or perform any math operation on it. It's a string with a limited character set. Treat it as such and your life will be much easier (think international calling, where leading zeros are … | |
Re: While taking a modulous on the hash function will increase the chance of a collision (you have less bits, of course it will), a good hash function will still be fairly 'random'. As for the chance of collision, I can't tell you the exact value (I don't have anything that … | |
Re: It sounds like you've added the event handler twice. Try removing lines 6 and 7 and see what happens. I suspect you'll see it open just one form. Most likely you created the event handlers in Visual Studio, which automatically adds them to the button events. You can check this … | |
Re: [URL="http://www.amazon.com/Operating-Systems-Design-Implementation-Second/dp/0136386776"]Operating Systems: Design and Implementation (Second Edition)[/URL] | |
![]() | Re: Without knowing anything about how you've named and collected your textboxes you could do something like this (and yes, there are better ways):[code]private void EnableButton() { Boolean enable = true; if (TextBox1.Text.Length == 0) enable = false; if (TextBox2.Text.Length == 0) enable = false; if (TextBox3.Text.Length == 0) enable = … ![]() |
Re: I use [URL="http://nlog-project.org/wiki/Documentation"]NLOG[/URL]. It's free and does more than you could ask for. | |
Re: Sounds like a plan. What have you done so far? | |
Re: Set the button's UseMnemonic property to true and add an ampersand (&) just before the letter in the button's Text property you want to use for the hotkey. This will automatically assign the ALT-<key> to that button. If you want to use CTRL or SHIFT you'll have to override the … | |
Re: This line[code]setPicsToVisible();//this method sets pictures to non visible[/code]gets the "Obscure Or Misnamed Method Of the Week" award. | |
Re: All controls have a Tag property which is there for you to put whatever you want in it. Store the full path there and you are golden. | |
Re: [icode]this.whateverAttributeYouWantToSet = whateverValueMakesSense[/icode] | |
Re: The reason is you never give the system time to redraw the panel, it immediately goes into sleep mode, then changes the panel back. Insert [icode]Application.DoEvents();[/icode] after each line where you change the color. You are also going to find that your GUI 'locks up' during the time where the … | |
Re: You can have your main app create a shared memory space and store whatever you need there. Then your monitoring app can read the values it needs. This is faster than using pipes, RPC or WCF, but is restricted to running on the same machine as your main app. You … | |
Re: How do the tickets relate to the seats/buttons? How are you generating the buttons? How do you know if a seat has already been sold? We need some code and details. | |
Re: If you create your heap with those numbers, you'd end up with 5 as one of the child nodes of 100 so finding it is a O(1) operation. | |
Re: Need more information. Count of what? Do you want it as a column or to fill the count table (choose one). What does your database look like? | |
Re: When it's running, click on debug->break all. This will stop the program and show you the current line that is running. If that line (and the lines around it) don't explain your issue, post the code here. | |
Re: [URL="http://en.wikipedia.org/wiki/APL_(programming_language)"]APL[/URL] | |
Re: You named the query "dbo.StoredProcedure2" but in your code you execute "dbo.StoredProcedure1". You are executing it as a non-query when you want results. You don't need an output value and it won't work anyway as you might get multiple rows returned. Your query should be:[code]SELECT Pr FROM TimeTable WHERE [Flight … | |
Re: You have 8 situations. So we check them all false, false, false - A, B, C, D, E are TRUE false, false, true - A, B, D, E are TRUE false, true, false - B, D, E are TRUE false, true, true - A, B, D, E are TRUE true, … | |
Re: [QUOTE=C#Jaap;1547258]Do you want to sort the text line in the text-file? In that case you have to read all lines from the text-file and add them to List<string> sortList = new List<string>(); After that you can sort the List and write it to another/the text-file[/QUOTE] It's much easier than that:[code]string[] … | |
| |
Re: I'm guessing you set the wrong property. Did you set the Name property or the Text property? | |
Re: since you are only displaying the time, add a fake date (1/1/2000 for example). | |
Re: No, you can't. Best you can do is method with those parameters. | |
Re: Line 23: Easier to write [icode]File.ReadAllLines("namenANDumber.txt")[/icode] Line 35: [icode]richTextBox1.Text += String.Format("{0,20} {1}\n\n",f.Name, f.Phone);[/icode] There is no need to call ToString() on Strings. | |
Re: HP 2000 Access, Basic, Paper Tape. Upgraded to an IMSAI 8080 with front panel switches. You entered code 8 bits at a time. It had 8 LEDs to display output (not LED displays, 8 LEDs. You learned binary). | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms173171%28v=vs.80%29.aspx"]Delegates[/URL] | |
Re: Static variables belong to the class, not an instance of the class. Whatever PortalSettingstxt1 is, it isn't a static class/class member. Since it needs an instance of a class to work, there is no way that the static string strconn can be initialized (which is done before class instances are … | |
Re: No, since you can't follow simple instructions and use [noparse][code] [/code][/noparse] tags. Plus I don't do homework anymore, I already have my degree. My favorite line in your code is:[code]for(i=1; i<=1; i++)[/code] | |
Re: The second doesn't work because you are trying to put code ([icode]bob = "hello";[/icode]) outside of a method (we know it's outside of a method because of the 'public' on bob, you can't declare public method variables). | |
Re: I don't burn ISOs, I use [URL="http://www.slysoft.com/en/virtual-clonedrive.html"]Virtual Clone Drive[/URL] |
The End.