Jump to content
Xtreme .Net Talk

Bucky

*Experts*
  • Posts

    803
  • Joined

  • Last visited

Everything posted by Bucky

  1. This is not the tool that Microsoft released, and it seems that MS no longer has that tool available on MSDN, for all links to it prove to be 404s. This GotDotNet VS plugin, VBCommenter, does what you're looking for, I believe.
  2. Don't use the ReadLine or ReadToEnd methods of the reader. Instead, get the Length of stream, then Read() the entire thing into a Byte array, and then convert it to a string using System.Text.Encoding.[whatever encoding].GetString().
  3. Just because a class is declared abstract does not mean that every method of the class must be overriden; code can still be written inside methods and property accessors of abstract classes. The CollectionBase faithfully implements the Add method of the IList interface so you don't have to. I've also had trouble overloading methods like you said, so I unfortunately cannot answer the second part of your question.
  4. The [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfSystemCollectionsCollectionBaseClassTopic.htm]CollectionBase class[/mshelp] is declared thusly: public abstract class CollectionBase : IList, ICollection, IEnumerable As you can see, CollectionBase already implements IList and overrides the Add method for you. You're just trying too hard. :)
  5. This is easily done in C# through [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/csref/html/vcwlkxmldocumentationtutorial.htm]XML documentation[/mshelp]. In VB.NET it's a bit more involved, but I believe there is a tool on MSDN you can download to add these comments to compiled VB.NET assemblies.
  6. Also check out the DataView class for sorting and filtering data ros.
  7. Yes, you'll want to put the thread on the client side of the request, so that the method that calls the service can run on a different thread. If you put it in the service, the client would still be waiting for a response, no matter what thread it's running on in the service.
  8. I suppose if you put the request to the service on its own thread, then yes, you could show the page and have the service return its results afterward. For this, I'd suggest reading up on [mshelp=ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconmanagedthreadingbasics.ht]threading[/mshelp].
  9. If you want, you could inherit the class that Rate function is a member of (assuming it's not sealed), then overload or override the method so it does what you want.
  10. Becase ASP.NET requires the postback of the page to the server to execute code and change the contents of a page, yes, you would have to refresh the page to requery the web service. To "gracefully" refresh you might put an Update button on the page, or set a meta refresh to a certain time.
  11. I should have linked to this before, but W3Schools is a great resource for learning XPath, XML, XSLT, and all that good stuff. Check it out first if you're stuck in the future. Now this is untested, but it should work: ' Selects the first book node with the author's last name of Austen Dim bookNode As XmlNode = root.SelectSingleNode("//book[author/last-name='Austen']") ' Show the title MessageBox.Show(bookNode.Item("title").InnerText)
  12. The XPath expression must not be correct then. Post an example of what your XML file looks like and give an example of what key would be and what it would return.
  13. Are you sure that the element in the file actually has some text in it? SelectSingleNode would return Nothing if the node didn't exist, and then an error would be thrown when trying to access InnerText. Therefore the node must exist, but it contains no actual text. Try InnerXml and see where that gets you.
  14. You wouldn't add the Add method to the Phone class, since it already has one. Instead, you would inherit some type of collection and overload the Add method, like PlausiblyDamp mentioned.
  15. Perhaps I'm unfamiliar with the syntax, but that is the oddest- looking error handling I've seen... See if you get any better results with this: Function GetValue(ByVal key as String) As String Try Dim xmlDoc As New XmlDocument() xmlDoc.Load("C:\test.xml") Return xmlDoc.SelectSingleNode("//" & key).InnerText Catch MessageBox.Show("Error reading file: test.xml") Return Nothing ' Return nothing if an error occurs End Try End Function
  16. You can read up on the HTML DOM here.
  17. Okay, leave out the Overloads keyword then. I also realized that, instead of calling InitializeComponent, you should instead call MyBase.New().
  18. You do not need to know the cursor's position to show the ContextMenu, just set the ContextMenu property of the RTB to your menu and it will pop up when the user right-clicks the control. As for the caret location, utilize the SelectionStart, SelectionLength, and SelectedText properties in your code.
  19. TcpListener.Stop(), perhaps?
  20. You need to overload the constructor of the IMWindow class to accept all those parameters. Make sure that you call InitializeComponent() in the constructor, too. This will go in the IMWindow class (this is just an example, you will obviously have to change the parameter names and types): Public Overloads Sub New(client As Object, profile As Object, _ something As Something, somethingElse As SomethingElse, name As String) InitializeComponent() ' Required ' Then store all the arguments in local variables here End Sub
  21. The DataView control is not strongly-typed, that is, it will not contain methods and properties that refer exclusively to your DataSet. You need to, instead, use the indexer of the DataRow to get the data from the "BUS_REG_ID" column: sqlDataAdapter1.SelectCommand.Parameters["@BusRegID"].Value = dataView1[this.listBox1.SelectedIndex].Row["BUS_REG_ID"];
  22. ConfigurationSettings is a member of the System.Configuration namespace. Add an Imports statement your code file to include this namespace. You may have to add a project reference to include this namespace.
  23. The Nedstat counter is only for the main page. Many guests are linked directly to posts through search engines, and many users also go directly to forums without visiting the main page often.
  24. 1) Call Server.GetLastError() in the Application's Error event handler. 2) A 404 error page can be assigned through the IIS options in the Control Panel.
  25. If you want to rant, click no further.
×
×
  • Create New...