2,157 Posted Topics

Member Avatar for anisha.silva

Can do it with one line Queue<String> myQueue = new Queue<String>(File.ReadAllLines(filePath + "file.txt"));

Member Avatar for Momerath
0
107
Member Avatar for de Source

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?

Member Avatar for Momerath
0
542
Member Avatar for king03

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)

Member Avatar for abhishekabhi
0
223
Member Avatar for cming21
Member Avatar for diptid
Member Avatar for diptid
0
73
Member Avatar for semicolon

[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

Member Avatar for semicolon
0
290
Member Avatar for Michael27

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

Member Avatar for Momerath
0
222
Member Avatar for cumadhu
Member Avatar for nickliutw

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>()); }

Member Avatar for Momerath
0
133
Member Avatar for priscilla.korostchuk

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++; } }

Member Avatar for Momerath
0
246
Member Avatar for king03

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 …

Member Avatar for nmaillet
0
231
Member Avatar for MasterHacker110

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.

Member Avatar for VatooVatoo
-1
153
Member Avatar for Farhad.idrees

You can't cast a string into an int. You can **Parse**, or **Convert** a string into an int.

Member Avatar for Momerath
0
107
Member Avatar for Farhad.idrees

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.

Member Avatar for Randlathor05
0
200
Member Avatar for icedome

[TimeSpan](http://msdn.microsoft.com/en-us/library/system.timespan.aspx) ts = Date1 - Date2; That's all you need.

Member Avatar for Momerath
0
124
Member Avatar for hcbckwidpeace93
Member Avatar for vinnitro
-1
129
Member Avatar for napninjanx

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 …

Member Avatar for Momerath
0
259
Member Avatar for k_nenad

Yes, you did all that work instead of just calling [URL="http://msdn.microsoft.com/en-us/library/07wt70x2.aspx"]Directory.GetFiles[/URL]

Member Avatar for Y D'hondt
0
552
Member Avatar for walid86

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 …

Member Avatar for erici
0
3K
Member Avatar for bhawnanarang91

If you are getting invalid object name, either the table isn't 'adb' or there is no 'Studentid' column.

Member Avatar for Momerath
0
204
Member Avatar for ezekel
Member Avatar for megdan

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 …

Member Avatar for Momerath
0
218
Member Avatar for Abdulkarim

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 …

Member Avatar for gusano79
0
98
Member Avatar for Afropuff01

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?

Member Avatar for Momerath
0
193
Member Avatar for umesh T20

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.

Member Avatar for john61484
0
178
Member Avatar for thechampp

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 …

Member Avatar for thewebhostingdi
0
166
Member Avatar for Mahesh57

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.

Member Avatar for Momerath
0
137
Member Avatar for akkbkht

it will cover the whole screen, but your controls will not resize unless you make them, so it will look odd :)

Member Avatar for akkbkht
0
491
Member Avatar for DrMAF

And why are you going through the reflection API, why not just instantiate the classes directly?

Member Avatar for nakor77
0
134
Member Avatar for ROSS679

What it is telling you is there isn't a txtCustomerID field in the database. Are you sure you spelled it right?

Member Avatar for ROSS679
0
138
Member Avatar for Mike Askew

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.

Member Avatar for Mike Askew
0
114
Member Avatar for BigHeart
Member Avatar for asthaaa

Are you going to show us the INSERT statement or are we supposed to guess what you've done wrong?

Member Avatar for hericles
0
116
Member Avatar for system_Broken

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 …

Member Avatar for samsylvestertty
0
138
Member Avatar for ROSS679

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 …

Member Avatar for Momerath
0
135
Member Avatar for damaritah

new creates objects, it doesn't 'clear records'. Can you be more descriptive of what you are trying to accomplish?

Member Avatar for hericles
0
108
Member Avatar for auwi987

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

Member Avatar for Momerath
0
236
Member Avatar for abelLazm

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 …

Member Avatar for Puzzlite
2
863
Member Avatar for zachattack05

Don't give users permissions they don't need. The application needs to do the insert, update, etc, but the users do not.

Member Avatar for zachattack05
0
170
Member Avatar for subratabanerjee
Member Avatar for sangita.t.adhikary

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?

Member Avatar for krunal1986
0
100
Member Avatar for grh1107

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 …

Member Avatar for grh1107
0
239
Member Avatar for brunoccs
Member Avatar for maurices5000

Article [here](http://www.codeproject.com/Articles/49798/Wake-the-PC-from-standby-or-hibernation) has a class for doing this.

Member Avatar for maurices5000
0
117
Member Avatar for saqi1986

[QUOTE=ddanbe;1547859]Why you want to do that? Just use the Sort method of the array.[/QUOTE] One word: Homework

Member Avatar for klklklk
0
1K
Member Avatar for vinnijain
Member Avatar for heavy.is.happy

The WinForms menustrip doesn't support vertical text. You'll either have to find someone who makes such a control, or build your own.

Member Avatar for Momerath
0
71
Member Avatar for massivefermion
Member Avatar for king03

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.

Member Avatar for ChrisHunter
0
269
Member Avatar for lucasalf11

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.

Member Avatar for lolafuertes
0
156

The End.