- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 24
- Posts with Upvotes
- 22
- Upvoting Members
- 16
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
152 Posted Topics
Re: It appears your data is actually an array (or list) of items; you can tell due to the square brackets: "PSQL": [ ... ] So, your structure should probably look something like this: Dictionary<string, List<Dictionary<string, string>>> That is, a dictionary with a string key and a list of dictionary (string, … | |
Re: Are you reading the database to get the current states of the seats before the code above is called? You would need to have a list of the seats that have already been taken. Then after line 4 in your code sample, you could check the user's selection against that … | |
Re: Hi, A couple of things to look at: 1 - In your function "MStudent" - what are you doing with the return value from this? Hint - check out how you are calling it. 2 - In the function "CalcAvrg" - take a closer look at how you are accessing … | |
Re: I was suspecting the same thing. Unless I'm missing something, in "getBook", you are re-using the "resultSet" variable, assigning it new results from getting the data on a single book. When you return back to the loop in "getAllBooks()", it's referencing the same "resultSet" variable, which a) contains the results … | |
Re: Can't do it your way - the "CellType" property is read only. If you are setting the columns in the designer, when you add a new column, you can specify the type from the drop-down. In code, if you are adding the columns by hand, you can do it this … | |
Re: From what perspective are you closing the forms? That is, are you trying to close all of the forms from the main form, or are you just trying to close a secondary form when you are done with it? As in, you open the second form, do some stuff, then … | |
Re: Enrique, It's because you declare the class "DataStructure" within the namespace of "CreateFile". When the file is created, the class is serialized with the namespace under which it was created. When the ReadFile project comes along, it cannot resolve the "CreateFile" namespace that's in the data file. Try this: declare … | |
Re: Check lines 68-70 - the test condition is "true" (that is, it will *always* be "true") - do you really want that? Shouldn't you have a condition you can test to see if you want to keep looping? Line 110 - what happens to the lines after the "continue" statement? … | |
Re: You can't declare an instance of a variable more than once. That's what's happening. Try this: [CODE]// Secondary.h #ifndef SECONDARY_H #define SECONDARY_H #include <iostream> using namespace std; #include <string.h> extern string HelloWorld; void HelloEarth(); #endif[/CODE] Change Main.cpp and Secondary.cpp to include "Secondary.h", remove the function declaration of "HelloEarth" from Main.h, … | |
Re: First, use code tags when posting - it makes reading the code easier. 1) As you've coded it, yes - kind of. That is, you create each object in main(), then pass each off to a distinct thread. However, there's nothing stopping you from, after starting the thread, from modifying … | |
Re: Check out this part of your code: [CODE]... bool radioButton1_CheckedChanged = true; bool convertToCelsius_CheckChanged = true; if (radioButton1_CheckedChanged == true) { convToF(double.Parse(Current.Text)); ...[/CODE] Won't this [B]always[/B] be the case...? Should the first 2 statements be moved elsewhere? | |
Re: I don't see a class declaration at the top of the code. It should be just before your first curly brace ({) at the top. Something like: [CODE]public class Teller[/CODE] When I put that in, the code ran. You really should have one outer loop that takes in the user's … | |
Re: Try [URL="http://www.dijksterhuis.org/finding-the-local-ip-addresses-in-c/"]this link[/URL]. | |
Re: Look at the last part of your long "if" statement: [CODE]else if(side1==side2 || side2==side3 || side1[COLOR="Red"]=[/COLOR]side3) // code error here[/CODE] Is something missing? | |
Re: In Panel.java, as the new last line of the constructor, type this: [CODE]ingredientScroll.setPreferredSize(new Dimension(200, 100));[/CODE] Of course, you may want to interrogate the parent (Frame) to get the dimensions and set the size of the JScrollPane appropriately. | |
Re: Ah, but they don't have the same *values* - you are constructing arrays of *objects*. Now, the objects may contain the same values, but that's it. Each object is different. You can either change over and make the arrays out of integers, or provide a comparison function that, when you … | |
Re: Generally speaking, it should be a loop in main() that is outside your current loop. That is, you enter the main loop to get the user's choice (1= reserve, 0 = exit). If the user enters a 1, you then get the input for the row and column and check … | |
Re: When you say "registry", do you mean the actual registry, or the certificate store (accessed by running "mmc", then from the "File" menu, selecting "Add/Remove Snap-in...", then selecting the "Certificates" snap-in, etc.)? If the latter, see below... It's been a bit, but I used this code in the past to … | |
Re: Your code is "converting" the object at element position 0 (an instance of MyDataType) to a string - but since it's an object, you are getting the type name. I'm assuming you want "nut" to appear in the text box. If so, the code that does this is: [CODE]textBox1->AppendText(arrayObject[0]->name);[/CODE] If … | |
Re: You are not giving the webBrowser component enough time to load, before you try to set the properties of the HTML document. Try using another button, like this: [CODE]private void button1_Click(object sender, EventArgs e) { // lets the browser control load up webBrowser1.Navigate(" http://www.httpsurf.com/ "); } private void button2_Click(object sender, … | |
Re: You're almost there... [CODE]byte[] fileStream = File.ReadAllBytes(Path); string first = Encoding.UTF8.GetString(fileStream, 0, 70);[/CODE] | |
Re: Here's some example code from MSDN: [url]http://msdn.microsoft.com/en-us/library/aa363634(VS.85).aspx[/url] | |
Re: Sounds like you need something like a "MultiMap". Check out [URL="http://www.dotnetperls.com/multimap"]this[/URL] link. | |
Re: How else would you? I mean, are you looking to load each "Student" into some sort of object, and then be able to say something like: [CODE]if (firstPerson.Age == secondPerson.Age) { ... }[/CODE] If so, you will still have to process the XML to load the objects. | |
Re: Have you seen [URL="http://www.functionx.com/vb/adonet/ta.htm"]this[/URL] article? (Not sure what the goofy photos are all about). Seems to cover some of the basic aspects of working with table adapters. It's in VB.NET, but should be easily translated to C#. | |
Re: Assuming the text "-- Select Date --" is the first item in the box, then this will work: [CODE]comboBox1.SelectedIndex = 0;[/CODE] Note that even when yo do this in code, it will cause the "SelectedIndexChanged" event to fire for the combo box. | |
Re: Knowing nothing more about your code that what you wrote, an extremely high-level solution could look like: 1) Convert your main() function to C# in a new C# Console Application project. 2) Create a new C++ "Class Library" project. 3) Copy all of your C++ code, minus the main() function, … | |
Re: Slight change, but you were close: [CODE]string sSQL = "SELECT * FROM Tasks WHERE Notes = '" + No + "'"; res = stmt->executeQuery(sSQL); [/CODE] Of course, this assumes that "Notes" in your database is a character column. If it is a numeric column, then leave the single-ticks out of … | |
Re: On line 61, you are defining a local version of "VideoTransmit" that eclipses the one you declared on line 23. Just state: [CODE]at = new VideoTransmit(new MediaLocator(sourcevideo), ipvideo, portvideo);[/CODE] and it will use the variable you declared on line 23. | |
Re: The assignment seems straightforward. Do you have some specific questions about it? | |
Re: Couple of things.... 1) your arrays/indexes are not in sync. Your board is "char[7,12]", meaning the indexes go from 0..6 and 0..11, respectively. Look at some of your loops - you have them checking for "j<13", meaning "j" can go up to 12, which is outside the bounds of the … | |
Re: When you specify a path in a string in code that contains the backslash character, you must "escape" it. So, if you want to save a file named "gunk.txt" to the root of the C: drive, you would have to type: [CODE]string sPath = "C:\\gunk.txt";[/CODE] That will be suitable for … | |
Re: You can trap the "ClientSizeChanged" event on the RichTextBox. In both cases (when the scrollbar appears and disappears), this event will fire. | |
Re: Well, that's because you can only send one "piece" of data through when you start the drag. May be a bit of overkill, but can you do this in "button1_MouseDown": [CODE]button1.DoDragDrop(button1, DragDropEffects.Copy);[/CODE] Then, in "button2_DragDrop": [CODE]Button oButton = (Button)(e.Data.GetData(typeof(Button)));[/CODE] Now, you have a reference to button1, and all of the … | |
Re: The main reason you see strings in all of these examples is that strings require the least amount of marshaling to push them across a connection. A string-based protocol is not necessarily a bad implementation; however, if you are in control of the client and server, then you can be … | |
Re: Your deletion routine is not correct - you are leaving the pointer from the previous entry in the list dangling. Example: if you enter the values 3, 2, 1 in your list, you will have a list in order from head of 1 - 2 - 3. When you go … | |
Re: What was not satisfactory about it? I looked over the code, and it seems to accomplish what you state in your post. The other alternative is to trap what row in the ListView the user clicked, then provide a DatePicker and/or a TextBox and a "Commit" button that you fill … | |
Re: Is the data in your file actual binary data, or is it hex strings? I've attached a small shell program that will let you browse for 2 files and convert the contents of the files to a byte array. It assumes the data in the file is binary format (actually, … | |
Re: Google is your friend: [URL="http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html"]http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html[/URL] | |
Re: I want to make sure I'm not missing something here.... You have a class (Customer - perhaps implemented in "Customer.cs") that holds the data for a Customer/PrizeList. You want to be able to access this class in the event handler? Can't you just declare a variable in the class (class … | |
Re: They will always be there - IF - the corresponding version of the .NET Framework is installed on the target machine. So, you would not include any of the individual DLLs with your application - you would check to see if the required version of the Framework is installed, and … | |
Re: Take a look at this post: [URL="http://stackoverflow.com/questions/575977/choosing-between-immutable-objects-and-structs-for-value-objects"]http://stackoverflow.com/questions/575977/choosing-between-immutable-objects-and-structs-for-value-objects[/URL] Be sure to read the comments under the second post - goes into a lot of detail concerning your question. | |
Re: I'm not 100% sure I understand, but what I think you're trying to say is: you have 2 (or 3) programs (console apps), that do all of their stuff in "main()". You need to combine them into one program, so you can run it and it will do all 2 … | |
Re: Try this: [CODE]// Convert < > etc. to HTML String sResult = HttpUtility.HtmlDecode(sData); // Remove HTML tags delimited by <> String result = Regex.Replace(sResult, @"<[^>]*>", String.Empty);[/CODE] If you are using a .NET Forms app, you will have to specifically reference "System.web" in order to get your hands on "HttpUtility". "Regex" … | |
Re: I copied your code down and compiled it; it seems to work fine for me. I added 3 players, and I can run the code and display all three just fine. I stopped the program and ran it again, and all of my data was still intact. I did have … | |
Re: Can't say if one is better than the other - I suppose it just gives the developer the flexibility of choosing a method based on the data he/she has in-hand. Methods 1 & 2 are closely related to each other (build an object and hand it in via a single … | |
Re: Check out line 23 - what's that equal sign ("=") all about? Remove that and see what happens. | |
Re: In the message, your excerpt from your "sample.log" file seems messed up. What are the field separators? Are they commas, or tabs, or something else? Assuming they are commas or tabs, you need to split the string that you read in on that delimiter. See [URL="http://www.daniweb.com/forums/thread82407.html"]this[/URL] post on how to … | |
Re: First, when you post code, use the "CODE" tags.... In Form1.cs, put the following code: [CODE]public void ToggleMenus() { menuStrip2.Enabled = !menuStrip2.Enabled; menuStrip1.Enabled = !menuStrip1.Enabled; menuStrip1.Visible = !menuStrip1.Visible; menuStrip2.Visible = !menuStrip2.Visible; }[/CODE] In Form1_Load, put this code: [CODE]menuStrip1.Enabled = true; menuStrip2.Enabled = false; menuStrip2.Visible = false;[/CODE] In Form2's listView1_Click method, … | |
Re: If you want to use 2 windows, then you should develop a Windows app, and after the main window is created, create a 2nd window. You can't really do a console app and Windows app at the same time (OK, perhaps you CAN, but I think it would be a … |
The End.