2,157 Posted Topics
Re: Exactly what would it be splitting the string on? No, you can't split a string using no character. I would really like to see an example of what you thought would happen. | |
Re: It's known as loop unrolling (or [URL="http://en.wikipedia.org/wiki/Loop_unwinding"]loop unwinding[/URL]). One thing you can do is move the [icode]int i1[/icode] to outside the loop. I believe the built in optimizer will do that for you, but it doesn't hurt. So your code becomes [code]int i1; int i2; int len = batchVertices.Length; for … | |
Re: I'm assuming this is inside a form and you have [icode]using System.Windows.Forms[/icode] at the top. I'd retype the line and see what it says. Also, instead of that clumsy tryparse statement, use [code]else if (Char.IsNumber(e.KeyChar) == false) {[/code] | |
Re: By default convert wants the DateTime in MM/DD/YYYY format. Do you have exception handling catching an error? Secondly, add [icode]datatTimePicker1->Refresh();[/icode] after you set it. | |
Re: To expand on what Cale said, the second parameter must be a filename, not a directory (though it can include a directory). | |
Re: Using a third variable is so passe for integer values: [code]int a = 1; int b = 5; a = a ^ b; b = a ^ b; a = a ^ b; [/code] | |
Re: The array you are copying into has to be allocated before you do the copy: [icode]Dim myTargetArray As Array = Array.CreateInstance(GetType(String), 15)[/icode] for example. | |
Re: Once you have built your list you assign it as the datasource for the ListBox:[code]listBox1.DataSource = urls;[/code] | |
Re: a,b,c,d are instance variables and you are treating them like they are class variables. You either need to instantiate an object of type RegularMatrix or declare them as static. | |
Re: [code]public String GetLastWord(String input) { String[] parts = input.Split(new char[] {' ', '.', '?', '!'}, StringSplitOptions.RemoveEmptyEntries); return parts[parts.length-1]; }[/code] | |
Re: You could try adding [icode]SqlConnection.ClearPool(Conn)[/icode] or [icode]SqlConnection.ClearAllPools[/icode] before your open statement. | |
Re: Did you mean to use arr values 0,1 and 3? And one of them is null if you are getting that error on that line. | |
Re: When you say the name is a string, do you have a list of allowable (or not allowable) characters? How many digits is the account number (depending on length there are different methods to check if it is all digits). Same for the password, what characters are allowed? | |
Re: You need to create a variable to hold the command and build it. Then you can use the exec function to execute the variable: [code]declare @sql varchar(200) select @sql = 'select tablename.' & @myColumnName & ' from tablename' exec @sql[/code] Please note that this is not a full procedure, you'll … | |
Re: You were good up until you hit: [QUOTE=Antenka;1392457]this change might resolve the error: [code=c#] IchecherMove[ , ] checker = new IchecherMove[9 , 9]; [/code] but you cannot instantiate interfaces. So we need some workaround ..[/QUOTE] You can declare arrays of interfaces, as it's not instantiating an interface, it's just creating … | |
![]() | Re: Add this to your project: [code]public static class Methods { public static String Limit(this string s, int n) { return s.Substring(0, n > s.Length ? s.Length : n); } }[/code] This is an extension method that allows you to limit the length of a string. You can then just do … ![]() |
Re: Yes there is, you can read all about the [URL="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx"]SerialPort[/URL] class right there. | |
Re: Yes, you can do that. In the debugger, what does it say the value of accessName is? You can all look at the [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx"]SQLParameter[/URL] class which will make your code safer from SQL Injection attacks if you allow user input anywhere. | |
Re: It sounds like the pdf library is using unmanaged resources and you aren't disposing of the object properly. Or they aren't disposing of the unmanaged resources. Does PDFDocument have a close() or dispose() method? | |
Re: You don't, C# will get rid of it when it feels like it. Really. | |
Re: [code]using (StreamReader sr = File.OpenText("filenamehere")) { String input; while ((input = sr.ReadLine()) != null) { //do stuff with line } }[/code] If you are going to be concatenating text, use StringBuilder to do it. | |
Re: If you don't want to deal with P/Invoke then I'd download [URL="http://code.google.com/p/cassia/"]Cassia[/URL] | |
Re: Read [URL="http://www.dotnet247.com/247reference/msgs/41/207281.aspx"]this[/URL] | |
Re: Set the Form.Enabled to false, show the dialog, when it returns, set the FormEnabled to true. | |
Re: Have you looked at the inner exception? Not sure if this will help, but it's the first place I'd look. | |
Re: Mind telling us where you get the error? | |
Re: [code]string[] parts = textBox1.Text.Split('.'); foreach (string str in parts) { int myInt; if (Int32.TryParse(str, out myInt)) { // Do something with the value in myInt } else { // the string wasn't an integer, can do something if I want } }[/code] | |
Re: When properly designed, Implementations would change more often than Interfaces. | |
Re: Can you give an example of the type of questions they asked as that will help fine more questions like that one :) | |
Re: Works fine for me, are you sure you aren't doing something to Name before you check it? | |
Re: [code]string[] mass = new string[this.LevelNumber];[/code] You tell a variable it will be an array [B]([icode]string[] mass[/icode])[/B]. Then you assign space to hold the values [B]([icode]= new string[this.LevelNumber];[/icode])[/B] | |
Re: Read [URL="http://www.switchonthecode.com/tutorials/csharp-tutorial-simple-threaded-tcp-server"]this[/URL] | |
Re: [code]float result; if (Float.TryParse(myString, out result)) { // parse was successful and result contains the parsed value } else { // parse failed }[/code] | |
Re: You'll have to open a different file to write to, not the same one as the original. Once done you can delete the original and rename the 'new' file. ![]() | |
Re: What you want is database Replication. You can read all about doing this with SQL Server right [URL="http://technet.microsoft.com/en-us/library/ms151198.aspx"]here[/URL]. | |
Re: You want [URL="http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx"]SQL Server Compact Edition[/URL]. It does everything you want :) | |
Re: 1) Look at the degree requirements for the four-year university, and take all the courses you can that are general requirements (English, History, Psychology, etc.) and get them out of the way. This will allow you to focus on your major when you transfer (and will cost less money). 2) … | |
Re: In your second code example you create a new frmEmployee (line 3). This new form is not the same as the initial form, so why do you think the initial form would have any data from it? | |
Re: [QUOTE=oredigger;1386259]First a couple of observations... -By calling [ICODE]randomnumber.Next(1, 7)[/ICODE] you will receive a "random" number whose minimum value is 1, and whose maximum value is 7. [/QUOTE] Actually, the upper bound is exclusive, so the number is from 1 to 6 ([URL="http://msdn.microsoft.com/en-us/library/2dx6wyd4.aspx"]Random.Next(Int32, Int32)[/URL]). | |
Re: Tunneling usually involves connecting to one machine on an open port and that machine forwards your data to a third machine on a different port. For example, lets say you want to connect to a chat server that uses port 7000 to communicate with. But you are at work, and … | |
Re: It sounds like you are reusing your same Point object in multiple places. How are you getting the Points? | |
Re: Yes, but you'll have to use a windows function to do so. Add this where you need it [code]private const int WM_VSCROLL = 0x115; private const int SB_BOTTOM = 7; [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);[/code] You can then scroll … | |
Re: Isn't this what [URL="http://folding.stanford.edu/"]folding@home[/URL] is doing? It's more complex than something you'll find posted on a forum like this. | |
Re: Did you copy the Infragistics DLL to the 2nd PC? | |
Re: I suspect it is something the 3rd party DLLs are doing. You can compile 64 bit applications on a 32 bit machine with no issues (at least I've never had any). | |
Re: BigInteger will give you the required precision, but 50^99 isn't 1.97654296816219383545704208846E+172, it is 15777218104420236108234571305655724593464128702180460095405578613281250000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000 or 1.577721810442023610823457130565572459346412870218046009540557861328125E+168 The built in calculator uses it's own types that aren't available in VB.NET | |
Re: [url]http://www.switchonthecode.com/tutorials/csharp-tutorial-simple-threaded-tcp-server[/url] | |
Re: With what encryption method were they encrypted? | |
Re: You have the sender object, cast it to a button and look at the Text property and do whatever you need to look up the age, hometown, etc. |
The End.