Jump to content
Xtreme .Net Talk

Nerseus

*Experts*
  • Posts

    2607
  • Joined

  • Last visited

Everything posted by Nerseus

  1. Let's assume you want to search by number, you'll use the XPath of "/Players[Number=8]". So do something like this: XmlDocument x; // Load up x here... //Now find the right player XmlNode player = x.DocumentElement.SelectSingleNode("/Players[Number=" + txtPlayerNumber.Text + "]"); // Now pull out the First and Last names Debug.WriteLine(player.SelectSingleNode("LastName").Value); Debug.WriteLine(player.SelectSingleNode("FirstName").Value); I'm not sure you need .Value on those last 2 lines of code, you might be able to use ToString instead. I'd have to test to be sure. -Nerseus
  2. Assuming you have Visual Studio, click on View->Tab Order. You can then just click on each control, in order, to have them renumbered automatically. Click View->Tab Order again to turn it off. -Ner
  3. Go the user's properties (get to the Users and Groups section of windows) and look at the Session Tab. You can override how long they're connected, when they're considered timed out, and what to do when they are (disconnect or end session). There might be a more global setting, but I'm not much of an Admin - at least it's a place to start trying :) -Ner
  4. Let's talk about easier and design time wins hands down. If you only have half a dozen controls, you could probably go either way, but still probably not worth it. Since it's all runningthe same code, memory usage and stability are the same either way. I can't say about the DataGrid. I think I've seen it asked before though - try searching these forums (link in the upper right). -nerseus
  5. If you let us know the format of your XML, I could provide a real sample. For now, look at XmlDocument. With it, you can load the XML string and find values by using the SelectSingleNode, SelectNodes and another function I can't remember to query attributes (they're exposed through an Attributes property, that has a method like GetByName or something). -Nerseus
  6. To understand when to use one, you need to know what's going on with the memory behind object and how they get passed to/from functions. Basically there are two types of variables in .NET: value type and reference type. Base types (int, char, decimal, etc.) and structs are value types, classes are reference types. When you pass a reference type ByVal to a function, you are only passing a copy of the *pointer*, not the data inside. That means that if you change the data inside the function, it affects the object itself and when you return those changes can be seen. What you CAN'T do when passing a reference type as ByVal is change the pointer inside the function. So if you had a variable ds in Function1 that pointed to a DataSet and you pass it ByVal to Function2 and Function2 sets it to Nothing, ds will still point to the DataSet. If you were to remove a table inside Function2, it would be removed for good and you won't see it when you return to Function1. Structs work differently. If you had a variable p that was type Point (in System.Drawing I think) and pass it ByVal to a function, it creates a copy of whatever data is in p and that's what you're working on inside Function2. If you change a value in Function2, it won't affect the variable p's data back in Function1. Now if you pass p ByRef, any change you make in Function2 will show up back in Function1. Hope that helps, ner
  7. Try checking on your keyboard shortcut, I think it's in Tools->Options->something here->Keyboard. From the keyboard settins you can filter the listbox by typing a word in the textbox, try "break" and see what shows up. Also, you can press the "Pause" button on the toolbar unless your process is hogging the CPU (not normally a good idea) in which case you'd have to put a call to Application.DoEvents() inside the loop. -Ner
  8. I'd only add that you should take into consideration your current employees that do development. If they already know VB, they should be a bit better off at knowing the syntax. If they don't know VB or C# then I'd lean towards C# as it seems a more "accepted" .NET language, though there aren't really enough differences to justify an argument that either language is really better. If your coworkers aren't developers, I wouldn't listen to them quite as much unless their opinions are needed for other reasons, developer related. For instance, if my boss weren't a developer and we had no plans on giving our sourcecode away or sharing with a 3rd party, then he should be going off my opinion of which language to use and not dictate it. I think I saw a thread awhile back in the Random Thoughts forum that discussed the main differences between VB.NET and C# (VolteFace listed some). I'd search there as well, if it helps. -Ner
  9. Ctrl-Break should still work just fine. -Ner
  10. You can also use Convert.ToInt32(str, 16). The 16 is the "fromBase" parameter, 16 for hex. -Ner
  11. Are you referring to this thread? Did you ever try the other suggestion by vsnt? Maybe you could show us a sample project? Is the website you're linking to public, so that we might try it? If you use the HTTPRequest object, as suggested by vsnt, you can read the text coming from the website directly. If it's truly just XML, you can probably get it into a string easily. I'm wondering if it's XML or just HTML formatted to look like XML. Have you tried other properties of the web control, like an InnerText (if that exists)? -Ner
  12. Often the link errors mean the linker couldn't find a library it needs. That usually means you need to add a reference, or point to a library file (.LIB). You'll have to find out what library that function call exists in and add it to your project. I could help in VS.NET and VS 6.0 but I'm not familiar with Borland's compiler. I'd search for something like extra directories (find the lib directories) and/or a place where you specify what LIB files to link to. -Ner
  13. I believe this is set through the Policies on the server you're attempting to log into. I can't remember the setting though. You might try searching at http://support.microsoft.com. -Ner
  14. Is this to automatically download a file? I wouldn't use the browser control if you can help it. It's probably best to use something that directly downloads the file given the actual address (the full URL to the file, be it HTTP or an FTP address). I would discourage trying to override the default prompting of a Save dialog as it's there not to impede you, but as a security so that you don't download something you don't want. -Nerseus
  15. Excellent! As a note, you might want to consider using ToString with an explicit format as I think not using an explicit format will use whatever the machine's regional settings want. I don't think the filtering in the DataSet is as nice with the regional settings. Meaning, if your regional settings is yyyymmdd (no slashes or dashes) then using "System.DateTime.Today" will produce a string in the yyyymmdd format. The filter, I would guess, wouldn't work. You can test it by changing your regional settings - I might be wrong on this one. -Nerseus
  16. Try this: "scheduled_completion_date < '" + System.DateTime.Now.ToString("MM/dd/yyyy") + "'" First, I surrounded the date value with double quotes. Then I used DateTime.Now instead of Today (not much difference that I know of). Last, I formatted the date with ToString to match what (I hope) the DataView's filter likes. -Ner
  17. If it's not from the same XmlDocument object then you'll get that error (I think). Have you tried to clone the node and add it, or maybe use the text of the node and insert that? I'm just throwing out some ideas, I haven't tried to append using the DOM in quite some time. -Nerseus
  18. Nerseus

    Toggle property

    First, you can use a Checkbox and set the appearance to Button (you might want the Flatstyle to System as well). As for why no more control arrays, check out this article or this one. There's another one that's more detailed but I can't find it offhand. Search these forums as the lack of control arrays in .NET is common question. -Ner
  19. No such thing as stupid questions... You should almost never use ActiveX unless there's no .NET alternative. I won't go into all the reasons, but they're a bit slower (going through COM), not managed code, and harder to install on client machines (must be registered). If you have a .NET alternative it's usually best to use that. -Nerseus
  20. Assuming you can find the class or function in the help, go to the class's (if a function) Overview help page and at the bottom you'll see a line like "Namespace: System.IO". That's what you need for the using part. The DLL Reference is almost always the same, or a higher named version if it doesn't exist. Meaning, if the namespace is System.X.Y.Z and you don't see the file System.X.Y.Z.DLL then look for System.X.Y.DLL or System.X.DLL -Nerseus
  21. I like Derek's idea of having a "Code Library Discussion" forum (or subforum, or whatever the powers that be like) for each of those forums. -Ner
  22. Whoops - I had no idea. Any ideas on how to help out, Derek? Do you just have to change the proxy into ArrayList from object, or do something else? -Ner
  23. Forgot to mention, MAKE A COPY OF THAT FILE. You don't want to mess it up :) -Nerseus
  24. Can you have your webmethod return something else, like a Hashtable (which is serializable) or a DataSet? Offhand, I don't think you can get the original data from the arraylist over a webservice. It's best to use objects that can be serialized (meaning converted to a format that can go over a stream, like the web). -Nerseus
  25. You can, as an alternative, "clutter" up the General forum and reference the tutorial or code library page. If it looks good, an Admin can move it to the right thread. A PM would work, too, but I think some users may not know that feature exists. Granted, it's not as easy as replying directly to the thread, which a moderator could tweak if the topic got out of hand. My biggest fear (relatively small as it is) is that people would post updated versions of the code that might be offtopic or go outside the scope of the original sample. I like the idea of having it kept "clean" since it's sole purpose is to provide easy access to good tips and samples. -Nerseus
×
×
  • Create New...