2,157 Posted Topics
Re: [QUOTE=Lusiphur;1336893]The one thing that concerns me is that, based on your original code, you should never have an unassigned value as there is only even or odd if dealing with an integer and it shouldn't be looking for a 3rd option. Unless you're somehow dealing with a negative integer... Brain … | |
Re: The system maintains a connection pool already, so your forcing everything into one connection isn't helping at all. Each query should use it's own connection object and unless you are making 1000s of queries a second, you aren't going to run into memory issues because of database connections. Is there … | |
Re: You don't give nearly enough information as there are a lot of ways to generate the "next subset". | |
Re: Nothing wrong with it. The first argument must resolve to a true/false (boolean) value. Yours resolves to a object, just as the compiler said. Try changing it to read: [code]savedPassword = (Application.UserAppDataRegistry.GetValue("newpassword")) != null ? Application.UserAppDataRegistry.GetValue("newpassword").ToString() : "defaultPassword";[/code] | |
Re: [QUOTE=mono_jit23;1336590]If i split the string and put it into a single array then every odd index is filled with a number and even index with signs(+,-,*,/). I don't think it will be so much different than using two separate arrays, rather it will optimize the code. :D[/QUOTE] Arrays start at … | |
Re: Cast it into the type that it is, not UserControl. You should be able to access it then. | |
Re: [code]FileStream f = File.Open(@"D:\TestData.txt", FileMode.Create); f.Close();[/code] | |
Re: [code]public Dictionary<String, List<String>> FileParser(String fileName) { Dictionary<String, List<String>> myDictionary = new Dictionary<string,List<string>>(); using (StreamReader sr = new StreamReader(fileName)) { List<String> temp = null; String index = null; String line; while ((line = sr.ReadLine()) != null) { if (line.StartsWith("AH")) { if (temp != null) { myDictionary.Add(index, temp); } index = line.Substring(2); … | |
Re: Just put your [I]Do This[/I] code inside the btAdd_Click() method. It will only execute when the button is clicked. There is no need to add a check anywhere in your code, the IDE has done that for you. | |
Re: 1.[code]Set result = 0 for each element in sequence A1..An, in reverse order, do if current element = key then set result = current index exit for loop end if end for output result[/code] 2.[code]set result = 0 for each element in sequence A1..An-1 do if current element > next … | |
Re: One way to do this is to start a transaction, insert into the audit table, then do the update. By using a transaction, you ensure that both changes are made successfully, or nothing happens at all (don't want an audit record when there is no change, or a change when … | |
Re: To answer your original question, the reason it only removes one control is because you are using if/else if. The first one that matches causes all the others to be excluded. Remove all the 'else' keywords and it will work how you think it should. To the second poster, why … | |
Re: Two things; Check that your [B]Email[/B] variable is set correctly. Add [B]smtp.DeliveryMethod = SmtpDeliveryMethod.Network;[/B] Another thing is you should catch the specific exceptions being thrown, rather than the generic [I]Exception[/I]. This will give you more information on why your code is failing: [code]SmtpClient smtp = new SmtpClient("10.0.0.1"); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; … | |
Re: Normally I see .00r files as part of a RAR archive. If it's not, the software at this link says it can read them [url]http://profile.software.informer.com/[/url] | |
Re: Another way to do this is start a new windows application, then go into the properties and switch it to a command line application. This gives you both a window and a command box. | |
Re: Use a dictionary<String,WhateverYourArrayIs> to hold all the values, and use the name to look them up in the dictionary. | |
Re: nick.crane is correct. Since you are using the built in serializer, and you have the DateTimeType object, it's going to include it. Implement IXmlSerializable and define how you want your objects serialized. | |
Re: If the top search result on google is your question asking about it, it probably doesn't exist. | |
Re: What database are you using? If SQL Server, then something like: [code]public void ReadData(string connectionString) { string queryString = "SELECT employeeID FROM employee;"; using (SqlConnection connection = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); try { while (reader.Read()) { Console.WriteLine("{0}", reader[0]); } } … | |
| |
| |
Re: In a stored procedure, the value of @@IDENTITY is the last indentity field generated. So I'd create a procedure to do the insert and return that value. Then you can use it to update your linking table (and they are tables, not databases :)) | |
Re: I suspect one of your values has a single ' mark in it, and this is throwing off your SQL statement. This is one of the reason you should use [URL="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx"]parameterized[/URL] statements, along with helping prevent a SQL injection attack. | |
Re: [URL="http://ts.nist.gov/WeightsAndMeasures/Publications/appxc.cfm#1"]This[/URL] might help. Or are you looking for something else? | |
Re: Use whatever makes you happy. Microsoft added the 'x' to things to indicate that they are now in XML format vs. their old formats. Use 'backup' if you want :) | |
Re: [URL="http://academic.research.microsoft.com/Paper/428576.aspx"]Reactive Pedestrian Path Following[/URL] [URL="http://www.hindawi.com/journals/asp/2009/935237.html"]Pure-Pursuit Reactive Path Tracking[/URL] | |
![]() | Re: You are probably using the built in WebBrowswer control to handle page rendering. Since this is IE, of course it's going to do what IE does (save history). If you want it to stop you could try setting the InPrivate Browsing to be on (if using IE 8. If your … ![]() |
Re: Your best bet is to create a method that takes a TabPage as a parameter, then creates the controls, attaches event handlers and adds them to the TabPage. That way you only have to design it one time, then can use it exactly each time. What you can do is … | |
Re: No it wasn't, since you didn't include psuedo code at all. | |
Re: Your structure Item contains Status, Title, Series, Author, TYpe and Description. It has a method called Item, but you are using it as a Property in line 47. Not sure what you are trying to do with that line, so can't suggest a fix :) BTW, it would be helpful … | |
Re: [url]http://www.codeproject.com/KB/system/GetHardwareInformation.aspx[/url] | |
Re: Post the code showing how you are doing the loading. | |
Re: Your problem probably comes from line 25 where you are attaching another reader to the socket each time you receive a message. You should have the reading in a loop or disconnect the current reader from the socket before you call Run() again. This should fix your problem: [code]private void … | |
![]() | Re: That's because you are looking at [B][COLOR="red"].[/COLOR][/B]h, scroll down more where the [B][COLOR="red"].[/COLOR][/B] goes away |
Re: Without seeing your code, how could anyone tell you what you might be doing that would slow down your software? | |
Re: Check out XNA, it has a [URL="http://msdn.microsoft.com/en-us/library/bb197911.aspx"]Matrix structure[/URL] with a 3d transform | |
Re: You do lots of strange things in your code: [code]for (int v = 0; v <= str11.Length - 1; v++)[/code] You do this one a lot. "v <= str11.Length - 1" is the same as "v < strl11.Length". No need to subtract one all the time, it's just more work. … | |
Re: [QUOTE=prvnkmr449;1328122][CODE]private void btnAddImages_Click(object sender, EventArgs e) { form_target myform = new form_target(); myform.Show(); myform.CopySelectedItems(lstviewTarget); this.Close(); }[/CODE] It will work [/QUOTE] It will work if your goal is to briefly show the form then close it. [I]myform[/I] is a local variable and thus will go out of scope as soon as … | |
Re: Using IDBConnection, IDbTransaction, IDbCommand, IDbDataParameter and IDataParmeter you can access most of the functionality of the various data providers without knowing which one you are actually using. So at runtime, instead of saving your connection as a SqlConnection (or OleDbConnection, etc.) you'd use and IDbConnection variable. As for sharing it, … | |
Re: [code]Color myColor = (Color)Enum.Parse(typeof(Color), <textfromcombobox>, true);[/code] Enum.Parse take three parameters: The type, the text to convert and whether it should ignore case or not (true = ignore). | |
Re: He's talking about VS 2010, which is Net 4. And I'm not sure what you mean, it's right there in the System.Numerics namespace. Make sure you have a reference to the System.Numerics.dll in your project. | |
Re: If I understand what you are trying to do, you could reset the flag when b is accessed: [code]private int myB; public Boolean bHasChangedValue; public int B { get { bHasChangedValue = false; return myB; } set { if (b != value) { b = value; bHasChangedValue = true; } … | |
Re: You can shorten your SQL to [code]cmd.CommandText = "SELECT count(*) from UsersTable AS ut WHERE ut.UserName = @UserName AND ut.Password = @Password"[/code] If it's not zero, then you have 1 (or more) users. | |
Re: Learn [URL="http://msdn.microsoft.com/en-us/library/ms754130.aspx"]WPF[/URL] | |
Re: You need to add some form of locking when you are accessing the list. Read [URL="http://msdn.microsoft.com/en-us/library/c5kehkcz%28VS.80%29.aspx"]this[/URL]. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/ms754130.aspx"]WPF[/URL] :) | |
Re: [QUOTE=zachattack05;1321095]I mean it basically means nothing right?[/QUOTE] Which is the same for any method at all. You can call a method anything you like, and it can do anything you like. By convention and unwritten agreement programmers try to name methods so that someone reading the code can make a … ![]() | |
Re: This is how I'd do it in C#: [code]Boolean foo(int[] a, int b) { Boolean result = false; Dictionary<int, Boolean> c = new Dictionary<int,Boolean>(); for (int i = 0; i < a.Length; i++) { if (c.ContainsKey(b-a[i])) { result = true; break; } else { c.Add(a[i], true); } } return result; … | |
Re: [QUOTE=Akill10;1325686]Stab in the dark here but would [code] String num; for (i=1; i < 6; i++) { if ("num"+i < 0) neg = neg + 1; if ("num"+i == 0) zero = zero + 1; if ("num"+i > 0) pos = pos + 1; }[/code] would this work?[/QUOTE] No, it … | |
Re: struct is considered a value type, and thus us non-nullable. You can make it a nullable type (by using the ? operator) but this has it's own issues as you'll have to redefine the inner portions of your struct. Just change struct to class and all is good in the … |
The End.