2,157 Posted Topics

Member Avatar for chrispepper1989

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 …

Member Avatar for Momerath
0
161
Member Avatar for philiop

[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 …

Member Avatar for philiop
0
143
Member Avatar for apanimesh061

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).

Member Avatar for Momerath
0
111
Member Avatar for crapmyster

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 …

Member Avatar for dansteel
0
1K
Member Avatar for philiop

[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.

Member Avatar for philiop
0
113
Member Avatar for dotancohen

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 …

Member Avatar for dotancohen
0
146
Member Avatar for Thijk

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).

Member Avatar for antechindia
0
158
Member Avatar for tawboiid

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 …

Member Avatar for tawboiid
0
2K
Member Avatar for DanMcNulty

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.

Member Avatar for jfarrugia
0
251
Member Avatar for tatarao25
Member Avatar for Momerath
0
286
Member Avatar for Avrajit

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 ...'

Member Avatar for Avrajit
0
643
Member Avatar for jmurph333

[code]textBox1.Text = "\"" + myStringVariable + "\""; textBox1.Text = String.Format("\"{0}\"", someVariable); char quote = '"'; textBox1.Text = quote + myStringVariable + quote;[/code]

Member Avatar for jmurph333
0
130
Member Avatar for apanimesh061

Because the chunk data size takes up 4 bytes. 4 for "RIFF" + 4 for the data size = 8

Member Avatar for Momerath
0
41
Member Avatar for stefilina

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.

Member Avatar for stefilina
0
139
Member Avatar for elshan0011

[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 …

Member Avatar for ddanbe
0
219
Member Avatar for xanawa

are the () required? Can they enter zero digits? Does the letter have to be upper case?

Member Avatar for xanawa
0
801
Member Avatar for Razer_90

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 …

Member Avatar for hirenpatel53
0
171
Member Avatar for shyla

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 …

Member Avatar for CsharpChico
0
218
Member Avatar for thekashyap

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 …

Member Avatar for thekashyap
0
386
Member Avatar for JhonMoney
Member Avatar for jmurph333

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 …

Member Avatar for jmurph333
0
117
Member Avatar for cwhizz123

[URL="http://www.amazon.com/Operating-Systems-Design-Implementation-Second/dp/0136386776"]Operating Systems: Design and Implementation (Second Edition)[/URL]

Member Avatar for rubberman
0
107
Member Avatar for alex-i

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 = …

Member Avatar for alex-i
0
103
Member Avatar for ahmedams

I use [URL="http://nlog-project.org/wiki/Documentation"]NLOG[/URL]. It's free and does more than you could ask for.

Member Avatar for C#Jaap
0
786
Member Avatar for vivekagrawal
Member Avatar for xanawa

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 …

Member Avatar for Momerath
0
130
Member Avatar for james6754

This line[code]setPicsToVisible();//this method sets pictures to non visible[/code]gets the "Obscure Or Misnamed Method Of the Week" award.

Member Avatar for TheJohnSpecko
0
90
Member Avatar for mklein

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.

Member Avatar for mklein
1
126
Member Avatar for AngelicOne

[icode]this.whateverAttributeYouWantToSet = whateverValueMakesSense[/icode]

Member Avatar for brokenarrow_vip
0
118
Member Avatar for jmurph333

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 …

Member Avatar for jmurph333
0
131
Member Avatar for barttoo

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 …

Member Avatar for Momerath
0
128
Member Avatar for johnt68

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.

Member Avatar for johnt68
0
82
Member Avatar for imfatyourefat

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.

Member Avatar for Rashakil Fol
0
193
Member Avatar for ramcho

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?

Member Avatar for Momerath
0
100
Member Avatar for jmurph333

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.

Member Avatar for Momerath
0
103
Member Avatar for Romil797
Member Avatar for TrustyTony
0
529
Member Avatar for Mystery_Planet

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 …

Member Avatar for Momerath
-1
122
Member Avatar for Na'Vi

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, …

Member Avatar for rubberman
0
172
Member Avatar for virendra_sharma

[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[] …

Member Avatar for virendra_sharma
0
176
Member Avatar for WolfShield
Member Avatar for WolfShield
0
194
Member Avatar for jmurph333
Member Avatar for jmurph333
0
2K
Member Avatar for xanawa

since you are only displaying the time, add a fake date (1/1/2000 for example).

Member Avatar for xanawa
0
216
Member Avatar for zachattack05
Member Avatar for zachattack05
0
63
Member Avatar for shyla

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.

Member Avatar for shyla
0
108
Member Avatar for Fortinbra

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).

Member Avatar for Kramer49
0
178
Member Avatar for choover12

[URL="http://msdn.microsoft.com/en-us/library/ms173171%28v=vs.80%29.aspx"]Delegates[/URL]

Member Avatar for Mitja Bonca
0
73
Member Avatar for moone009

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 …

Member Avatar for Momerath
0
102
Member Avatar for Kashh

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]

Member Avatar for geojia
0
293
Member Avatar for spunkywacko

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).

Member Avatar for spunkywacko
0
95
Member Avatar for Voidz

I don't burn ISOs, I use [URL="http://www.slysoft.com/en/virtual-clonedrive.html"]Virtual Clone Drive[/URL]

Member Avatar for darrylpatterson
0
165

The End.