2,157 Posted Topics

Member Avatar for Borzoi
Member Avatar for Borzoi
0
745
Member Avatar for james6754

I'd make an interface or abstract question class. Let's go with interface for now: [code]interface IQuestion { String Text { get; } Boolean CheckAnswer(String ans); }[/code] Then you make up some question classes: [code]class RectangleQuestion : IQuestion { Random r = new Random(); int answer; public String Text { get …

Member Avatar for james6754
0
113
Member Avatar for rbduck09

Move the } on line 45 to line 57. This will enclose the calculation in the 'else' part of your if statement. Indenting properly would show you why your problem is happening, most IDEs will do that for you.

Member Avatar for rbduck09
0
224
Member Avatar for ibdatx
Member Avatar for Dasharnb777

[URL="http://www.daniweb.com/code/snippet349476.html"]Combination Generation[/URL], the link to which was in the previous question you asked.

Member Avatar for Dasharnb777
0
281
Member Avatar for Dasharnb777
Member Avatar for Momerath
0
2K
Member Avatar for manugm_1987

1) The name of the form is [icode]projdll.abc[/icode] 2) You'll want to read [URL="http://www.daniweb.com/forums/thread349598.html"]this[/URL] thread.

Member Avatar for Momerath
0
112
Member Avatar for AngelicOne

Without seeing the application it's hard to tell what they might have done.

Member Avatar for Momerath
0
130
Member Avatar for legend_89757

I suspect it is your orderby clause. The running sum would be in order but you force an order by date, which throws off the sum. You'll probably have to do two queries: first that orders the data, second that generates the output.

Member Avatar for legend_89757
0
118
Member Avatar for Pokenerd

Winforms has broken support for transparent images. Unless you are willing to write your own control to deal with it, you'd be better off moving to WPF or XNA depending on what you are trying to do.

Member Avatar for Pokenerd
0
164
Member Avatar for hmnetonline

Line 21 you declare that method static, then try to call a non-static method (DoCommand). Non-static methods require that you create an object of the class first so you have something that actually has the method. You can make all the DoCommand() methods static or you can create an object …

Member Avatar for Momerath
0
609
Member Avatar for Behseini
Member Avatar for AngelicOne

[URL="http://easywebcam.codeplex.com/"]Here[/URL] is a project to provide a class for manipulating a web camera.

Member Avatar for AngelicOne
0
101
Member Avatar for manugm_1987

In the solution explorer right click on references and select Add Reference. Click the browse tab and browse to your DLL, select it and hit OK. Now you have access to the public classes of the DLL. Create a form from whatever class is in the DLL that contains your …

Member Avatar for arsheena.alam
0
84
Member Avatar for Kath_Fish

[code]using System; using System.IO; namespace TestBed { class Program { static void Main(string[] args) { String[] lines = File.ReadAllLines("data.txt"); String[] first = lines[0].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); String[] second = lines[1].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < first.Length; i++) { Console.WriteLine("{0} …

Member Avatar for Momerath
0
210
Member Avatar for yoge911

It sounds like you are using ClickOnce deployment and have failed to provide the files needed on a webserver (The URI giving the error is pointing to a local file on your machine).

Member Avatar for yoge911
0
206
Member Avatar for jineesh

Just a comment about line 20 in your code above. You don't ever have to Flush a memory stream. It doesn't do anything.

Member Avatar for Momerath
0
598
Member Avatar for Jessurider

I'd ask whoever wrote the WebCam_Capture.dll if you are having issues with it. And what delay are you experiencing? Delay between frames, delay at start, what?

Member Avatar for Momerath
0
146
Member Avatar for Behseini

A sample on how to color text. [code] private void button1_Click(object sender, EventArgs e) { string text1 = comboBox1.SelectedItem.ToString(); string text2 = comboBox2.SelectedItem.ToString(); richTextBox1.Text = String.Empty; richTextBox1.AppendText(text1); richTextBox1.Select(0, text1.Length); richTextBox1.SelectionColor = Color.Red; richTextBox1.AppendText(" "); richTextBox1.AppendText(text2); richTextBox1.Select(text1.Length + 1, text2.Length); richTextBox1.SelectionColor = Color.Green; }[/code]

Member Avatar for Behseini
0
5K
Member Avatar for zachattack05

Yes, it's going to fall apart. By having just one connection to the database like this it's possible for multiple threads to place the connection in various states, interrupt threads that are trying to read/write the database, etc. Create a new connection for each thread. The way the .NET database …

Member Avatar for zachattack05
0
156
Member Avatar for trume

It's not C#, it's a mixture of C/C++ and C#. And to help you (maybe), show me a method that takes two parameters and returns the difference between the two. We'll convert this to a random number soon, just want to see if you know how to create methods.

Member Avatar for prvnkmr194
0
91
Member Avatar for Momerath

Generating permutations of a sequence is a problem that is commonly asked. It's fairly easy to do if you know how many items will be used beforehand, but a generic method to do so would be better. The snippet will do a lazy generation of the permutations (the next one …

Member Avatar for ddanbe
3
2K
Member Avatar for spunkywacko

[URL="http://msdn.microsoft.com/en-us/library/z50k9bft.aspx"]Array.Copy(Array, Int32, Array, Int32, Int32)[/URL] For example, if you want to copy 10 elements starting at the 23rd you'd use [code]string[] newArray = new String[10]; Array.Copy(myArray, 23, newArray, 0, 10);[/code]

Member Avatar for spunkywacko
0
91
Member Avatar for manugm_1987

Take a look at [URL="http://gsraj.tripod.com/dotnet/reflection.html"]this[/URL] and [URL="http://msdn.microsoft.com/en-us/library/system.type.aspx"]this[/URL].

Member Avatar for manugm_1987
0
199
Member Avatar for AngelicOne

If the forms are identical with the same functionality, you can just create a new instance of the form. [code]Form1 form1 = new Form1(); Form1 form2 = new Form1();[/code]

Member Avatar for Momerath
0
77
Member Avatar for lianpiau
Member Avatar for C#Jonathan

Them being interfaces has nothing to do with it. It's because of the way IEnumerables work and I'm not sure how I can explain it :) Change your arrays to List<> arrays and it should solve your problem. You'll probably have to add ToList() to the end of the LINQ …

Member Avatar for Momerath
0
151
Member Avatar for neptunethought

Do they use meaningful variable/method names? Do they comment code? Do you have a general idea what the code is trying to do? Reading others code is a skill you'll get better at with practice. Having partners who write clear code with meaningful names and comments helps (which they should …

Member Avatar for Chellam2
0
147
Member Avatar for trume

[code]class Program { public static void Main() { Console.Write("Enter the number of seconds: "); int seconds = int.Parse(Console.ReadLine()); TimeSpan fullTime = ConvertToHMS(seconds); Console.Write("Full-time is: {0}", fullTime); Console.ReadKey(); } public TimeSpan ConvertToHMS(int n) { return TimeSpan.FromSeconds(n); } }[/code] Not very useful but it is a subroutine.

Member Avatar for trume
0
125
Member Avatar for digitig
Member Avatar for Momerath
0
168
Member Avatar for manugm_1987
Member Avatar for Momerath
0
58
Member Avatar for neptunethought

[URL="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx"]List<T>[/URL] is a type of generic collection. When you create an instance of an a generic you have to specify what type of objects will be in the collection, thus the <int> in your example (meaning a List of int).

Member Avatar for Momerath
0
107
Member Avatar for ajinkya112

You need some form of DNS service to resolve the IP address. If you can't run your own, there is a service called [URL="http://www.dyndns.com/services/dns/"]DynDNS[/URL] that specializes in resolving dynamic IP addresses. You just have to run their software on the machine with the dynamic IP and you are good to …

Member Avatar for ajinkya112
0
583
Member Avatar for ashish101

* When the type of x is int or uint, the shift count is given by the low-order five bits of count. In other words, the shift count is computed from count & 0x1F. * When the type of x is long or ulong, the shift count is given by …

Member Avatar for ashish101
0
204
Member Avatar for Arjun_Sarankulu

I'm guessing the error is in line 80. What's the value of SingleLine, b and c when it gives you the error?

Member Avatar for Momerath
0
106
Member Avatar for MrCapuchino
Member Avatar for jotae

[icode]dtr = dst.Rows[iPosact];[/icode] No . between Rows and [. You also don't need the new DataRow() part on the line above, you can combine the two lines into[code]DataRow dtr = dst.Rows[iPosact];[/code]

Member Avatar for Momerath
0
117
Member Avatar for Jessurider
Member Avatar for Ezzaral
0
85
Member Avatar for Jessurider

The DLL for WebCamCapture is in the bin/debug directory and this is a C# forum.

Member Avatar for Jessurider
0
230
Member Avatar for jay_el_em
Member Avatar for virendra_sharma

Just FYI, your code has a bug in it. Any odd number that is the square of a prime will show as a prime. I've fixed that in the below code. [code]Boolean IsPrime(int n) { Boolean result = true; if (n == 1) { result = false; } else if …

Member Avatar for Momerath
0
184
Member Avatar for pupucashu

Line 43 - Shouldn't you be using insert or push_back to add an item to a vector?

Member Avatar for jonsca
0
427
Member Avatar for JOSheaIV

You could try using the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.dividerwidth.aspx"]DividerWidth[/URL] on the specific columns as it pads the right side of the column. Same property on the rows might get you something close to what you want. You'll have to get the column/row collection from the DataGridView and figure out which ones you want …

Member Avatar for ddanbe
0
654
Member Avatar for lochnessmonster

For clarity. A lot of the typedefs help explain usage. DWORD tells you more than unsigned long as to what the intended usage is.

Member Avatar for L7Sqr
0
207
Member Avatar for nutrion

If you don't use threads then all the work you want to do when you press Start will run on the GUI thread, which means the GUI won't update (you can't press buttons, etc.) while the work is being done. So you create a method that does all the work …

Member Avatar for Mitja Bonca
0
118
Member Avatar for moose333

Here is a sample program that will get you all the values that start with Date: [code]using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace TestBed { class Program { static void Main(string[] args) { String[] lines = File.ReadAllLines("test.txt"); // Read all the lines into an array IEnumerable<String> date = …

Member Avatar for moose333
0
486
Member Avatar for Singlem

Since null isn't anything you can't call ToString() on it. You'll have to check for it: [code]npc_text.text1[0] = reader["text0_1"] == null ? String.Empty : reader["text0_1"].ToString();[/code]

Member Avatar for Singlem
0
113
Member Avatar for Kath_Fish

You need to explain more about what you mean by combination? Do you want every item in list 1 combined with an item in list 2?

Member Avatar for Kath_Fish
0
99
Member Avatar for tendaimare

If you can read BNF [URL="http://msdn.microsoft.com/en-us/library/aa933118%28v=sql.80%29.aspx"]this[/URL] page has everything you need.

Member Avatar for Momerath
0
99
Member Avatar for vishal.patil

Line 8 isn't needed. Use StringBuilder to build strings. Depending on the log size you could be creating thousands to millions of strings which will result in the Garbage Collector making frequent runs.

Member Avatar for mcriscolo
0
416

The End.