2,157 Posted Topics
Re: I'm not sure what the problem is. You have a 26x26 array and only 26 unique values. You will have duplicates. | |
Re: StartInfo is used to start a process, not retrieve the information about a running process. Use [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.mainmodule.aspx"]MainModule[/URL] property to get the [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.processmodule.aspx"]ProcessModule[/URL] class of the running process. It has information about running processes. | |
Re: [code]namespace MyGlobals { public static sealed class Global { public static int ScreenWidth = 1024; } } // somewhere else in your code int width = Global.ScreenWidth;[/code] | |
Re: You need a [ICODE]using System.Drawing;[/ICODE] at the top of your code (and System.Drawing.dll in your references, if it isn't there). | |
Re: Did you try properly ending the SQL statements with a ';' character? | |
Re: The regex is creating three named matches (so you can get each part of the phone number) called NPA, NXX3 and NXX4. So we have this: [ICODE]^[/ICODE] - must match the beginning of the string [ICODE]\(?[/ICODE] - starts with a paren (the ? makes it optional) [ICODE](?<NPA>[2-9]\d{2})[/ICODE] - Create a … | |
Re: [code]myTextBox.Text = myFloatValue.ToString("#,###.00");[/code] Will convert a float to the format you want. For input, set that as the mask in the textbox (not tested). | |
Re: Why not use [URL="http://msdn.microsoft.com/en-us/library/3c932kx5.aspx"]GetAttribute(String)[/URL]? | |
Re: It's not new, sorry. Euler used it in his famous proof. ![]() | |
Re: What is line 8 for? Since the variable [I]line[/I] is a string (you define it as such in line 7), why are you converting it to a string? Line 10 you need put quotes around what you are comparing. [code]using System; using System.Text; namespace Text { class Program { static … | |
Re: The document is in error, the second array does not derive from the first. I suspect it's a typo (many of them). | |
Re: Lines 33 and 34 declare space for the arrays, but don't actually allocate objects into the space, so when you try to use them in lines 36 and 37 there is nothing there to access. You need to actually declare the objects (not just the array to hold them). You'll … | |
Re: It means exactly that. As long as what has focus can accept a paste and there is something to paste, it will work just like when you copied that text from the webpage where you found it and pasted it into the box to post your message :) | |
Re: Have you looked at [URL="http://msdn.microsoft.com/en-us/library/ms754130.aspx"]WPF[/URL]? | |
Re: int types are always initialized (to zero). You can check if a string type is null ([icode]if (myString == null) { // Not initialized[/icode]. In general, a null reference means the variable doesn't have an object. | |
Re: Here is a sample class:[code]enum Sex {Unknown, Male, Female}; public class Human { Sex sex; DateTime birthday; public Human() { sex = Sex.Unknown; birthday = DateTime.Now(); } public Human(Sex s) { sex = s; birthday = DateTime.Now(); } public Human(DateTime d) { sex = Sex.Unknown; birthday = d; } public … | |
Re: First, your methods have no return type, so it won't even compile. Second, the variables you declare in the methods only exist in that method. Third, the proper way to declare a nested class would be [icode]A.B bb = new A.B()[/icode] Forth, B does not inherit methods from A, so … | |
Re: You can use Clear() to empty a list, or you can just create a new one (and let the garbage collector clean up the old one). | |
Re: [code]int numberOfFives = 0; foreach (int i in myIntArray) { if (i == 5) { numberOfFives++; } } Console.WriteLine("There are {0} fives in the array", numberOfFives);[/code] | |
Re: To answer your question, rather than tell you how to do it, yes, it could return those values. If the file doesn't exist, it will return whatever is in exp.Message. If some other error occurs it will return "not possible to open a file". Otherwise it returns "all right!" | |
Re: You can try removing all the object creation you are doing (the Vector3 ... lines) and just use the properties directly (except for the EulerAngle). I'd also remove all the calls to ToString() and let the system do the conversion itself. Probably won't make a difference, but who knows what … | |
Re: Since you can move in any direction (as long as you haven't visited that spot before) you'll need to generate all possible moves from each spot, and continue doing so until you have generated all possible words (boggle says 3 letters or more). So I'd generate a list of all … | |
Re: [URL="http://www.amazon.com/Head-First-2E-Real-World-Programming/dp/1449380344/ref=sr_1_1?ie=UTF8&s=books&qid=1292544604&sr=8-1-spell"]Head First C#[/URL] [URL="http://www.amazon.com/Pro-2010-NET-Platform-Fifth/dp/1430225491/ref=sr_1_1?ie=UTF8&s=books&qid=1292544643&sr=1-1"]Pro C# 2010 and the .NET 4.0 Platform[/URL] [URL="http://www.amazon.com/C-4-0-Nutshell-Definitive-Reference/dp/0596800959/ref=sr_1_1?s=books&ie=UTF8&qid=1292544689&sr=1-1"]C# 4.0 in a Nutshell[/URL] | |
Re: What type is Price and what values do you have in from.SelectedItem/to.SelectedItem? I'd take a look at what the sql variable looks like before you call ExecuteReader(). | |
Re: Do you open the socket? We'll need more code to see what might be the problem. | |
Re: You could use a BinaryWriter to put them both into the same file. I'd put some sort of header to indicate the length of the string and the length of the image part. | |
Re: It does exactly what you think it does. You don't say what problem you are having so it's hard to figure out what it is you think it is doing. Your code there works fine. | |
Re: While you can use pointers in C# (using unsafe code) what you really want to do is pass a reference. Change your constructor to [code]public ReceivesArray(ref int[,] the Array) {[/code] and then add ref before any variables used to call the constructor. The compiler will complain if you are doing … | |
![]() | Re: Here is a sample program that takes what is in textBox1 and puts it into textBox2 one word at a time. The form has the two textbox, a button, and a timer (with a delay of 5 for my test). [code]using System; using System.Collections; using System.Windows.Forms; namespace WindowsFormsApplication2 { public … ![]() |
Re: Don't even bother with the if. Enum's are basically just numbers so you can do this: [code]Store.Category = (ItemCategory) category;[/code] | |
Re: It's probably the bitmap object that is causing the issue, it being used by the GUI and whatever code you use to update the bitmap. | |
Re: Your Form_Load event executes after the Form_Paint event so myBitmap hasn't been set yet. You need to initialize variables in the Form constructor. | |
Re: If you developed the DLL in C# just add a reference to the DLL in your project and it will be available to the project. You can add a "using" statement so you don't have to type all the rest out. What you are doing is trying to import it … | |
Re: Without knowing what [B]column[/B], [B]value[/B] and [B]dbcontent[/B] contains there is no way to answer your question. Also, what's the point of passing in two parameters that you only use to compare to each other (line 6)? | |
Re: If the javascript code has more than 32 bytes then it is wrong as SHA256 is a 32 byte hash. I'm not sure what you mean by 'any unidentified characters' since it is a collection of bytes, not characters. Does the javascript turn the hash into a string representing the … | |
Re: [url]http://www.codeguru.com/cpp/misc/misc/internetexplorer/article.php/c11007/[/url] | |
Re: When you attempt to read from the MemoryStream, it is pointing at the end of the buffer. Reset the pointer to the start of the MemoryStream buffer before reading [icode]outS.Seek(0, SeekOrigin.Begin);[/icode] | |
Re: Use the BeginExecuteXXX methods (and EndExecuteXXX) of the SQLCommand object. Not sure how you'll handle keeping the query state between pages, though. | |
Re: You need to call AcceptChanges on the dataset before it will update the database. You should be able to see everything in the database explorer. | |
Re: Change your while loop to [code]MyWriter.Close(); String myString; List<int> myList = new List<int>(); while ((myString = MyReader.ReadLine()) != null) { myList.Add(Int32.Parse(myString)); } int[] myArray = myList.ToArray();[/code] There are better ways to do what you are doing, I'm just giving you something that should work based on what you have. | |
Re: Don't put the connection string in the code, put it in the Application settings. That way you don't have to worry about it, the people using it (the other developers) will have to set it. | |
Re: You get the error because C# considers the backslash character (\) and escape character to use to get a special characters (line return or linefeed). There are two ways to solve this problem, the first being the one Mitja posted, by prefixing the string with the "this is a literal … | |
Re: [URL="http://www.amazon.com/s/ref=nb_sb_ss_c_1_21?url=search-alias%3Dstripbooks&field-keywords=compiler+construction&x=0&y=0&sprefix=compiler+construction"]Compiler Construction[/URL] | |
Re: Unbind it from the dataGridView, add the row, and rebind it. | |
Re: Try changing line 3 to [code]graphics.FillEllipse(new SolidBrush(Color.FromName(mycolor)), e.X, e.Y, 4, 4);[/code] If the color name isn't valid, you get black. | |
Re: I'd try turning on double buffering for the form, and using SuspendLayout/ResumeLayout on the pictureboxes (suspend them all before doing the move, resume them after). You could also try suspending and resuming layout on the form itself. | |
Re: Here is a C# translation: [code]private void MenuItem6_Click(Object sender, EventArgs e) { if ((this.PictureBox1.Image != null)) { ArrayList barcodes = new ArrayList(); BarcodeImaging.FullScanPageCode39(barcodes, this.PictureBox1.Image, 10); if (barcodes.Count > 0) { StringBuilder message = new StringBuilder(); message.Append("Found barcodes:" + Environment.NewLine); foreach (object bc in barcodes) { message.Append(bc.ToString() + Environment.NewLine); } MessageBox.Show(message.ToString(), … | |
Re: Read this about [URL="http://msdn.microsoft.com/en-us/library/aa730869%28VS.80%29.aspx"]Application and User settings[/URL] | |
Re: Make the query [code]SELECT ActiveStatus, Count(ActiveStatus) FROM tblUserData GROUP BY ActiveStatus[/code] Your front end script can then get which status the row is and how many times it occurs. |
The End.