2,157 Posted Topics
Re: Just FYI, in Windows Vista/7 it is no longer recommended that files be placed in the directory with the executable (this is a safety feature to prevent malicious code from overwriting your exe files). The proper place is in the Users directory. Either [B]//Users/Public[/B] or [B]//Users/<username>[/B] depending on if the … | |
Re: There are many different ways to connect to MySQL databases. [URL="http://www.connectionstrings.com/mysql"]This[/URL] site gives connection strings for each of the different ways. | |
Re: What error do you get when it crashes? And what is the DoChecking method? | |
Re: One (or more) of the objects [B]osdb[/B], [B]txtID[/B], [B]txtItemName[/B] or [B]txtItemDesc[/B] is null. | |
Re: Create a method that adds the controls you want to a parent control. Call this method passing in each of the tabs for however many tabs you have. | |
Re: When you resize (minimizing and restoring is a form of resizing) you'll have to redraw all the lines as they aren't part of the form. One way to handle this is to store the graphics object you are using to draw on and restore it when the draw event occurs. | |
Re: Did you check the Message property of the exception to see what it says? | |
Re: Lines 4,5: The Text property of both these controls is a string, don't call ToString on strings. Lines 9, 10, 11 - You are mixing OleDB objects and SQLServer objects. Pick one set. Line 12. You've not opened the connection that I can see. | |
Re: Remove the "Provider..." from your connections string and get rid of all the OleDB objects. Or if you must you OleDB (and its limitations) the provider should be "SQLNCLI10" for SQL Server 2008. | |
Re: What are you using to display the directory/file (what control)? | |
Re: You use abstract method to indicate that the child classes all have a behavior that is implemented in different ways. For example, we could have an abstract class 'Animal' with child classes 'Lion', 'Giraffe' and 'Dung Beetle'. The 'Animal' class has an abstract method 'Eat'. For a Lion object, this … | |
Re: Use [URL="http://www.dependencywalker.com/"]Dependency Walker[/URL] | |
Re: Since the web is stateless, if you are trying to pass information from the server to the client then back from the client to the server you'll have to have some form of state variable. | |
Re: [icode]writer.Write(w.ToString("X2") + " ");[/icode] | |
| |
Re: Most likely your problem is the reference to the TrackRecord array. C# has no way of knowing how big it is when it is returned from the C++ code (since you are passing it as a reference) so it fails. One way to fix this is to pass it a … | |
Re: Without knowing what you are trying to do it's hard to tell :) But you have effectively created a singleton factory but using a dictionary instead of class for the factory. | |
Re: [QUOTE=ddanbe;1460557]Write two versions of it the one you already have, and a newone with if statements. Use the ildasm tool to watch how many il-instructions you gain or loose, so you can see for yourself what is best! Success![/QUOTE] You can do this from within Visual Studio if you are … | |
Re: Start a [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx"]Stopwatch[/URL] when you want to start timing, and stop it when you are done. | |
Re: Strings are a special case in C# and are treated like value types for equality comparison, so using == or != is fine. If you are testing for less than or greater than, you'll need to use [URL="http://msdn.microsoft.com/en-us/library/zkcaxw5y.aspx"]String.Compare[/URL] | |
Re: In line 13, if you are trying to read a char, why are you assigning it to an int? Use string formating to output as hex (x.ToString("x2") for example). You need to rethink the Counts method, as you aren't passing references or the character read at all. | |
Re: I'd guess that the DPI of the PDF document is set much higher than you think it is, so the image appears to shrink. Your screen is probably around 96 DPI, whereas most documents are 300 DPI. This would make your image look about 1/3rd the size it does on … | |
Re: I suspect that something in startFunc is trying to update the listbox (calling updateTextBox()). Since startFunc isn't the UI thread, it can't do this without invoking the update. Take a look at [URL="http://msdn.microsoft.com/en-us/library/a1hetckb.aspx"]this[/URL] example on MSDN. | |
Re: What you learn about OOP will carry over into any OO language, though there are some differences between them all (C++ allows multiple class inheritance while C# does not, for example). As for developing games, I recommend you head on over to [URL="http://create.msdn.com/en-US/"]XNA[/URL]. They have (free) tools, demos, lessons, etc. … | |
Re: If your object requires special processing when the GC wants to clean it up, implement the IDisposable interface on your object. | |
Re: If you want to sort dates you need to generate them as year-month-day, not day-month-year, or sort them in the select statement from the database, not after you get them. | |
Re: In ReadDials the first thing you do with errorFlag is set it to zero. You don't check it's value so I'm not sure what the problem is. | |
Re: You dispose of the objects in your stop method and never create new ones. | |
Re: Instead of using array indexes of 0..n-1, use indexes of 0..n+1. Place your values in 1 .. n so you have an 'empty' boarder around the entire array. Make sure those values are always 'empty' and then you don't have to do any kind of boolean check. Every valid element … | |
Re: Two vectors that intersect are always coplaner, so there is only one angle. As for your two spheres, I'm not sure what you are looking for, the formula for the line described using the 2nd sphere as the origin? The vector from the center of the 2nd sphere to the … | |
Re: Instead of making me try to figure out all your code, why not tell me which line generates the error? | |
Re: declare the method private. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.checkedindices.aspx"]CheckedIndices[/URL] will return a collection of indexes that are checked. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.checkeditems.aspx"]CheckedItems[/URL] will return a collection of items that are checked. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.getitemchecked.aspx"]GetItemChecked()[/URL] returns a boolean telling you if the specific index is checked. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkedlistbox.getitemcheckstate.aspx"]GetItemCheckState()[/URL] returns a [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.checkstate.aspx"]CheckState[/URL] for the specific index. If you only care about the checked ones, the first … | |
Re: I would create a class to hold the information for each member, something like: [code]enum Sex {Male, Female} public class Member { public int ELO {get; set;} public int Competitions {get; set;} public int Rank {get; set;} public Sex Gender {get; set;} public String Title { get { // code … | |
Re: For 18 decimal we have: 2's complement = 0001 0010 (16 + 2, since it isn't negative nothing else needs to be done). Hexadecimal = 0x12 Octal = 22 Sign-magnitude = 0001 0010 (since it is positive first bit is 0, the next 7 bits are just the value, again … | |
Re: You will have to create your own in C# and use [URL="http://msdn.microsoft.com/en-us/library/aa288468%28v=vs.71%29.aspx"]P/Invoke[/URL] to access the functions in the DLL. Link is to a tutorial on P/Invoke. | |
Re: You can't, that's a TV myth. Zooming in on a black pixel just makes a larger black pixel. There are no super algorithms that will make the zoom image show you more detail, as there is no more detail to show. | |
Re: AddMonths is working fine here. A common belief is that it changes the object you are using, when it does not. [code]using System; namespace Text { class Program { static void Main() { DateTime dt = new DateTime(2010, 1, 1); DateTime next; for (int i = 0; i < 10; … | |
Re: They do hold the values, so I'm not sure what you are asking here. You might want to put the keyword 'public' in front of your property statements (lines 3 and 4) so they are accessible from outside the class. | |
Re: No, myobject holds a reference to an instance of the class Class1. [url]http://www.csharp-station.com/Tutorials/lesson08.aspx[/url] | |
Re: My suggestion would be to make your code more OO. You should have something like a 'enemy' class, and derive new classes from this for each enemy. These could then have a method (GetValue maybe) that would return the value of that enemy. As for your highscore problem, you'll need … | |
Re: While this has nothing to do with MS SQL (you are in the wrong forum), read [URL="http://www.chriscalender.com/?p=28"]this[/URL]. | |
Re: Have you looked at [URL="http://www.codeproject.com/KB/cs/Get_bitmap_from_AVI_file.aspx"]this[/URL] on CodeProject? Or maybe [URL="http://www.codeproject.com/KB/audio-video/avifilewrapper.aspx"]this[/URL]? | |
Re: The assigning of an empty string is so when the line where it adds the character to the string won't cause a null reference error (you can't add a character to a null). The [ICODE]mystring.Length-1[/ICODE] is to get the index of the last character. Since indexes are zero based the … | |
Re: Your StreamReader is only available in the block where it is declared (in the very small try {} catch. Move lines 11 through 16 to be inbetween lines 43 and 44 so the StreamReader will exist for the entire block of code. | |
![]() | Re: [URL="http://lmgtfy.com/?q=how+to+analyze+an+algorithm"]How to analyze an algorithm[/URL] |
Re: I've always used [URL="http://msdn.microsoft.com/en-us/library/system.array.getlength.aspx"]GetLength()[/URL] | |
Re: 1) System.Data.DataSet 2) System.Data.SqlClient.SqlCommand 3) System.Collections.Generic.List<T> 4) System.Collections.Hashtable 5) System.Net.HttpWebRequest (or one of the other Http classes) 6) System.Data.SqlClient.SqlException 7) No idea what org.apache.velocity.Template does for you. 8) System.Data.SqlClient.SqlConnection | |
Re: Most likely you'll need to invoke on the client form ([URL="http://msdn.microsoft.com/en-us/library/zyzhdc6b.aspx"]Invoke[/URL]) | |
Re: You are starting at array index 0x8000 which is the 0x8001 byte into the array (arrays start at 0). You are trying to read one more byte than you have array size (0x8000 + 0x8000 = 0x10000). |
The End.