2,157 Posted Topics
Re: Your sample code isn't a 'has a', it's a 'is a'. 'Has a' would be[code]class Student { BankAccount ba = new BankAccount(); }[/code] And I believe 'association' means 'has a'. | |
Re: It doesn't look like you ran tlbexp.exe on the dll to generate the COM interface. All you need to do is check the COM box in the project, assign a GUID to the assembly, then run tlbexp.exe on the resulting DLL. It will generate a *.tlb file that you register … | |
Re: [code] public string Name { get { return name; } private set { name = value; } }[/code] And last I checked, serialization doesn't use set/get, it uses reflection. You'd also mark the variable name as the data member, not the property. | |
Re: If you consider starting the trend of giving benefits to the rich by stealing from the middle class and poor a good thing; or starting the failed 'War on Drugs' that has increased our prison population to levels not even seen in countries run by dictators is a good thing; … | |
Re: You can't serialize a delegate. Since you can consider it a function pointer, what would it look like when serialized? | |
Re: Yes, B.dll will be using the same static property that the rest of your code uses, so it will have the same value everywhere. | |
Re: [code]cmd.CommandText = "UPDATE address" + "Set unitnumber =" + Addresstxt.Text + "WHERE streetnumber=148";[/code] Why are you building this out of parts of strings? What you are actually getting is: "UPDATE addressSet unitnumber = " + Addresstxt.Text + "WHERE streetnumber=148" Notice that you did not put a space between [B]address[/B] and … | |
Re: [QUOTE=darkagn;1545760]I have never used the WebBrowser control, but my understanding of it was that it was simply a frame for viewing web pages. I believe you need to implement other controls such as a Back button and call the browser's GoBack function when the button is pressed.[/QUOTE] You would be … | |
Re: I'd say your username/password are not correct in line 21. I'd also not post them in a public forum. | |
Re: [code]DIM myMatch as Match DIM userInput as String Dim searchString as String myMatch = Regex.Match(searchString, userInput & @"\w+");[/code] | |
Re: You are trying to insert a record that has the same primary key as another record. How is your table defined? | |
Re: [code]for (int m = 0; m < cName.Length; m++) { Console.WriteLine("{0} {1} {2}", cName[m], cMarks[m], cGrade[m]); }[/code] | |
Re: The author of that code is just trying to return the last line of the ping output. They figured that mdev only occurs in the line they want data from, so that was a good thing to grep. | |
Re: You can't achieve your last question. It isn't possible to have an even number of rays that are evenly spaced, with one right in the center. You have to have an odd number to have one in the center. | |
Re: You'll need to perform a [URL="http://en.wikipedia.org/wiki/Lexical_analysis"]Lexical analysis[/URL] of the code. Your software will need to 'understand' that something like [icode]// This is a test of the sprintf() function ...[/icode] doesn't have a function call, isn't using . operators, etc. [URL="http://tldp.org/HOWTO/Lex-YACC-HOWTO-5.html"]This[/URL] might help. | |
Re: Is this a managed or unmanaged DLL? What class is 'img'? Have you tried catching [URL="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.externalexception%28v=VS.100%29.aspx"]ExternalException[/URL] instead of ArgumentException? | |
Re: Does your string only contain the values 0-9 and the letter A? If so, you only need 4 bits to store that, which means you can pack 2 characters in each byte, halving the amount of storage required. | |
Re: While there is a way to do it, it looks messy, so best* thing is to create an extension method! [code]namespace extensions; public static class MyStringExtensions { public static String ReadFrom(this string str, char start, char end) { string result = null; try { int s = str.IndexOf(start); int e … | |
Re: Yes, you have to tell it what type T is going to be by using the constructor. | |
Re: I have used them a bit. If you are running short executing threads, the overhead of the thread safe collections overwhelms the multi-thread gains. | |
Re: [code]public void FileAppendToLine(String pathfile, Object[] array) { String[] lines = File.ReadAllLines(pathfile); if (lines.Length < array.Length) { Array.Resize(ref lines, array.Length); } for (int i = 0; i < array.Length; i++) {pathfile, lines) { if (String.IsNullOrEmpty(array[i])) { array[i] = lines[i].ToString(); } else { array[i] += "," + lines[i].ToString(); } } File.WriteAllLines(pathfile, lines); … | |
Re: Do you have a stored procedure named 'Insert_PublicationsA'? That would be the first place I'd check. | |
Re: Your queuing is inconsistent. cycle 0 : queue job 1, do work on job 1. Job 1 not finished so requeued. cycle 1 : new job inserted in front of queue (job 2). Work job 2. Job 2 not finished requeue. cycle 2 : no new job. Do work on … | |
Re: [code]List<int> list1 = new List<int>(); List<int> list2 = new List<int>(); a & 0x8000 == 0 ? list1.Add(a) : list2.Add(a); b & 0x8000 == 0 ? list1.Add(b) : list2.Add(b);[/code] Checks if the high order bit is set. | |
Re: O(n) solution:[code] int value; for(int i = 0; i < myArray.Length; i++) { value ^= myArray[i]; } Console.WriteLine("{0} occurs only once", value); [/code] Works when all other numbers come in pairs. Make sure I get a good grade. | |
| |
Re: Open it in a web browser, like any other page. | |
Re: Paths are normally giving with the \ character not /. Also which version of Access created the database? | |
Re: Create an interface and implement it in classes B and C. This interface should contain all the common methods. In class M create a List<T> of this interface and add the created classes B and C to this list. Since they implement the same interface, you don't care which class … | |
Re: Give them the free [URL="http://www.microsoft.com/downloads/en/details.aspx?familyid=048DC840-14E1-467D-8DCA-19D2A8FD7485&displaylang=en"]PowerPoint viewer[/URL] then fire them for wasting time viewing joke emails during work hours :) | |
Re: The click event has a sender object, use it to obtain the name. You'll have to attach to the click event of the controls. | |
Re: Step 1: Post in a the VB.NET forum, not the C# forum. | |
Re: [code]public static void GetStudents ... [/code] Your method returns nothing (void) yet your other code expects it to be returning something. | |
Re: [QUOTE=MackSwagga;1536539]I am trying to write a small program to keep track of my movie collection but I can't seem to get the streamwriter(I think thats what its called to work). Right now I am working on writing to a text file.[/quote] What is or is not happening? [quote]I had a … | |
Re: Need to see some code and database field descriptions/types | |
Re: It's doing exactly what you told it to do. Notice the problem times cross the midnight boundary. You need to include the actual date (you know, day/month/year) in the comparison, not just the time. | |
Re: You have a lot of repetitive code in your case statements. Think of a way you can convert all this code into a method and just call it. Simplifies making changes to the way the selections are handled as you only need to make changes in one place. Changes like … | |
Re: Animated gif works fine in a picturebox. Animated png does not. | |
Re: It's possible to receive 0 bytes. The sender can send as much or as little data as they want. | |
Re: Create a new header file named "xxx.h". Put [icode]String ^ParseBBCode(String ^OriginalText);[/icode] in the new header file. Include it in the file where you call ParseBBCode. | |
Re: One or more of M, N and/or sims is equal to zero. Or you have the amazing coincidence that the sum of each row is zero. | |
Re: B = value & 0x1f G = (value >> 5) & 0x3f R = (value >> 11) & 0x1f | |
Re: It's telling you that you misspelled "AddressBook" as "AdressBook". And since there is no "AdressBook" there is no object to work with, thus no rows or items. | |
Re: [URL="http://msdn.microsoft.com/en-us/library/gg145045.aspx"].NET Framework Class Library[/URL] | |
Re: [code]private void comboBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { comboBox1.Items.Add(comboBox1.Text); e.Handled = true; } } [/code] You'll probably have issues with the dataset as databound controls don't like to be changed. | |
Re: [code]Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("Namespace.XMLFileName.xml"); XmlDocument xdoc = new XmlDocument(); StreamReader reader = new StreamReader(s); xdoc.LoadXml(reader.ReadToEnd()); reader.Close();[/code] You'll have to put your own name in there | |
Re: Post your actual code, not something you think is your code. Use [noparse][code] [/code][/noparse] around the code to properly format it. Indicate any lines that give you an error and what the error message actually is (again, don't paraphrase, cut/paste the error message). |
The End.