2,157 Posted Topics
Re: If you want to have more than one of them, then it can't be static. Objects are allocated on the heap, not sure what else you want to know. | |
Re: From [Eric Lippert's blog](http://blogs.msdn.com/b/ericlippert/archive/2009/02/02/properties-vs-attributes.aspx): Think about a typical usage of attributes: [Obsolete] [Serializable] public class Giraffe : Animal { ... Attributes typically do not have anything to do with the semantics of the thing being modeled. Attributes are facts about the mechanisms - the classes and fields and formal parameters … | |
Re: The error is caused by this "SELECT * FROM tbl_student WHERE" + ddl_SearchBy.SelectedValue + "= @" + ddl_SearchBy.SelectedValue + "" Pretend the SelectedValue is the word 'Tuesday' (without the quotes. This becomes "SELECT * FROM tbl_student WHERETuesday= @Tuesday" Do you see what you are missing? I also don't think your … | |
Re: Since your problem is one of permutations, using an array and something like [this](http://www.daniweb.com/software-development/csharp/code/349081/permutation-generation) will let you generate the arrangement as you need it. | |
Re: Try setting `Font = null;` in the Dispose method of TextBoxEx. I don't see anything here that would cause a GDI leak. | |
Re: `x*(x-2h+m*m*x+2*m*c-2*m*k) = r*r-h*h-c*c-2*c*k-k*k` If you distribute the x on the left side you get `x^2-2hx+mmx^2+2mcx-2mkx` Combining like terms gets you (and bringing the right side over to the left) `(mm+1)x^2+(2mc-2h-2mk)x + h^2+c^2+2ck+k^2-r^2 = 0` Since m, c, h, k and r are all constants, you can substitute `a = mm+1` … | |
Re: Ln 100,000,000 = 18.42068 Ln 150,000,000 = 18.82615 It should have increased 2%, not 1.522 times (52%). | |
Re: First, you don't use integrated security. Users have no permissions on the database, just the server does. Everyone talks to the server, server talks to the database (n-tier). Users can install whatever SQL tool they want, but they can't get through the databases firewall, since it only accepts connections from … | |
Re: Like Zach said you can think of them as a folder tree, and I actually use a folder tree with the same structure as my namespaces :) My largest project currently has: Momerath.Collections Momerath.Collections.Generic Momerath.Extensions Momerath.Numerics Momerath.Sharith Momerath.Sharith.Arithmetic Momerath.Sharith.Math Momerath.Sharith.Math.MathUtils Momerath.Sharith.Math.Primes Momerath.Strings Momerath.Strings.Search And I have some other stuff I'm … | |
Re: Is it a .net DLL? Sounds like it isn't based on the error message. | |
Re: Assuming you've declared all the variables correctly foreach(DataRow row in dt.Rows) { if (tbox_Username.Text == row.Item[0] && tbox_Password.Text == row.Item[1]) { Position = row.Item[2]; Fname = row.Item[3]; Lname = row.Item[4]; con.Close(); return true; } } con.Close(); return false; But there are better ways of checking for valid login that don't … | |
Re: This line char[] str = new char[10]; You can get rid of everything after *str* as you replace what was created when you assign the ReadLine() result to it. | |
Re: Commenting on an 8 year old post and directing it to someone who hasn't logged on in 3 years. I'm sure he'll get right on that. | |
Re: 1) The C++ dll has nothing to do with CLR 2) You have to use the CLR or it's not a .Net language 3) It compiles it 'just in time' for execution 4) It's MSIL 5) Sort of. There have been specialized processors built that 'understand' a specific language and … | |
Re: Don't select all of them, just select the one you want to check and see if anything is returned. Much faster. | |
Re: After the [Singularity](http://en.wikipedia.org/wiki/Technological_singularity) no one will do any more programming. | |
Re: Constructors don't have return types (they are returing the object being constructed and the compiler is smart enough to know this) so when you declare it as **void**, it thinks you are trying to define a method with the same name as the class. | |
Re: Depends. Do you have a static Main method in your code? We can't see what you've done from here. | |
![]() | Re: Line 211 I assume. Where is e defined such that it is in scope? Nowhere, and that's why you get the error. Why do you create that other method to handle the event? Just put the code in the event, or pass 'e' to the method. ![]() |
Re: Not without seeing all the code. We can't tell how you implemented your graph structure as we can't see your screen from here. | |
Re: Loops foreach(String key in dic.Keys) { foreach(String item in dic[key]) { Console.Write("{0}, ", item); } Console.WriteLine(); } | |
Re: Get a list of the files, pull the version number out of the name, delete the older ones. You'll want to look at [Directory](http://msdn.microsoft.com/en-us/library/system.io.directory.aspx), [String.Split](http://msdn.microsoft.com/en-us/library/system.string.split.aspx) or [String.IndexOf](http://msdn.microsoft.com/en-us/library/5xkyx09y.aspx), [String.Substring](http://msdn.microsoft.com/en-us/library/aka44szs.aspx) and [Double.Parse](http://msdn.microsoft.com/en-us/library/fd84bdyt.aspx). You could also do it with [Regex.Match](http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.match.aspx) | |
Re: Oracle (like most databases) doesn't support passing in multiple values as a single parameter. So you are stuck doing one of two things: 1) Build the SQL statement dynamically, adding as many parameters as you need. 2) Create a function in Oracle that takes a string and splits it into … | |
Re: Check if it's in the ListBox first if (ListBox1.Items.Contains(id) == false) ListBox1.Items.Add(id); | |
Re: At the very least you should be calling [Thread.SpinWait](http://msdn.microsoft.com/en-us/library/system.threading.thread.spinwait.aspx) so your threads will let other stuff run while they idle. You also might consider using Monitor.Wait and Monitor.Pulse to stop/start your processes. | |
Re: Not really, MS designed it to be that way. | |
Re: Windows Forms applications support TrueType fonts and have limited support for OpenType fonts. If the familyName parameter specifies a font that is not installed on the machine running the application or is not supported, Microsoft Sans Serif will be substituted. Also The text rendering offered by the TextRenderer class is … | |
Re: Well, with the property it would be **GlobalClass.GlobalVar**, you don't have access to m_globalVar. | |
Re: To get a int, you can try something like this int myNumber; String input; do { Console.Write("Enter a number : "); input = Console.ReadLine(); } while (Int32.TryParse(input, out myNumber) == false); This will prompt the user over and over again for a number (integer number) until they enter one. | |
Re: One way to do it is to make sure that the class T implements IComparable class MyClass<T> where T : IComparable This will work, but limits the user of the class to defining one and only one way to arrange the objects. A better way is to use the IComparer … | |
Re: And [this](http://www.daniweb.com/software-development/csharp/code/351309/a-collection-of-sorts) | |
Re: What is the value of *dataRow["y"]* when you look at it in the debugger? | |
Re: You'll need to include the MySql assemblies in your install, or install them separately. | |
Re: Of course your code doesn't work, you've told it not to do so. Think about what happens on each line. For example, you set curLine to 0 on line 4. Then on line 8 you increment curLine. Line 9 you ask "is curLine equal to zero?". It never will be … | |
Re: Note that random is from the low number inclusive, to the high number exclusive. So Random.Next(0,10) generates a number from 0 to 9, not 0 to 10. Random.Next(100) generates a number from 0 to 99. If you want a number from 1 to 10, use Random.Next(0,10) + 1 | |
Re: Where do the classes NativeListWindow, Win32, ComboBoxInfo, etc. come from? They aren't C# classes. I suspect you want the C++ forum. | |
Re: You need to be more clear about what you mean when you say "nothing happens". You do know that Visual Studio makes a copy of your database when you are running in Debug mode, so you won't see any changes in the original? | |
Re: I'd just use one of the many twitter C# libraries (like [this](http://ntwitter.codeplex.com/) one). You can also use that to see how they accomplished what you are trying to do. | |
Re: http://www.daniweb.com/software-development/csharp/code/351471/simple-math-expression-evaluator-using-emit | |
Re: Do you get an error? How do you know it's not working? | |
Re: There are many ways to read a text file in C#. Which do you want to do: 1) Read 1 character at a time 2) Read 1 line at a time 3) Read all the lines and put them into an array. 4) Read the entire file as one long … | |
Re: c is a local variable, it doesn't exist outside the method. What is happening is you are passing in a string (the textbox) then changing what c is referencing, not the value that it is referencing. This has no effect on the Textbox reference. Returning a value is the prefered … | |
Re: For lines 10-12 you can parallelize the outer loop, but not the inner. Also it will error on the first iteration as there is no index -1 (j = 0, j-1 = -1). | |
Re: In line 12 you declare the method as *void*, meaning there is no return value. In line 20 you tell the Console.WriteLine to use the return value from ReturnPattern, which as we've previously seen, it has none. This is your error. If you want to use it as part of … | |
Re: What this means is that the cashOrders table is actually based off information from two tables (or more). What's the statement you use to get the information for the cashOrders table? | |
Re: Why are you implementing IDisposable at all? You don't allocate any unmanaged resources, so there is no need for you to do so. Also, this is C#, we don't normally have destructors unless there is a good reason to do so. This isn't one of them. | |
Re: Visual Studio runs on Windows, so you'll have to have Windows to use it. But, there is [MonoDevelop](http://monodevelop.com/) which will run on a Mac. | |
Re: You need to set a Parameter for the userid. Look up SqlParameter on msdn. |
The End.