Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You are adding a variable of type Form1 to the HashTable and then trying to get a frmAddItemNumber out of the HashTable - they are different types hence the InvalidCastException.
  2. When you say you can't access public variables from the nested classes what errors do you get? Could you post the code where you are trying to access them?
  3. You are probably better making it a public function (possibly a shared (VB) or static (C#) function) of a class and calling this from your other code.
  4. if you wish to have access to the features of a particular form then either declare the parameter as the form type (probably the best way) or within the code cast the form to the correct type. As to it depends on the object type - if it is a class then it's passed by reference, if a struct then a copy is passed.
  5. As a developer the more platforms I can run my software on = more potential customers = more potential money = good thing. Pretty simple equation. Being able to create a web site on a machine running XP and VS 2003 is a reasonably easy experience, being able to then FTP that to a linux box running apache and mono and watch it work is an impressive thing indeed. The tools for .Net under linux are currently lacking (although SharpDevelop is apparently looking ok), then again VS is an expensive tool, but you get what you pay for. As a developer I can use VS / XP and sell to customers running Win2k, 2003 server etc. but also have the potential to sell to schools / councils etc that may run **ix for whatever reason (budget, politics). MS are still getting my money. They probably wouldn't have got any from the **ix house anyway so they don't lose out.
  6. You'll kick yourself - looks like a typo: In the SELECT you have a field intYearRT but in the datareader code you refer to it as inYearRT (missing a 't')
  7. Using ASP the code behind the control events only runs on the server not the client browser (if you need to handle things at the client level then a client side script would need to be written - normally in javascript). For the server side code to run the page needs to be submitted to the server, the server code runs and then a new page is sent down to the browser - this is a post back. Post backs can be expensive in terms of bandwith and time (especially if the client has a slow connection) and should be kept to a minimum, so by default only buttons cause this client->server->client round trip to occur. Auto postback just causes this to happen for controls other than buttons.
  8. Windows is 1) where their main revenue stream is and 2) there expertise lies. By submitting parts of the CLR and C# etc to the ECMA and ISO standards bodies they leave the market open for others to develop the framework. MS not having the same experience of Linux / MAC / **nix / whatever would involve a very steep learning curve with an enourmous amount of resources needing to be allocated when perhaps other vendors could implement it more efficiently (http://www.go-mono.com for example)
  9. You will only get the event on a page postback, either put a button on the form as well or set the checkbox's AutoPostBack property to true.
  10. You would override the Catalogue class' ToString... Public Class Catalogue Public ID As String Public Name As String Public Sub New(ByVal sID As String, ByVal sName As String) ID = sID Name = sName End Sub public overrides Function ToString() as string return Name 'Or whatever you want to display in the listbox... end function End Class (Not near VS at the moment so that may not be perfect but should give you the idea)
  11. is smtp.oceanfree.net your IIS server?
  12. You could always use NAnt as a build tool till MSBuild becomes publically available.
  13. Your best bet may be contacting the SMTP server provider - an error of 550 indicates the server has been configured to not send to the destination address. As to a way round the problem then if speaking to their administrator doesn't resolve anything you may need to consider an alternate mail provider.
  14. Should work from a sub main without any problems. Also is there any reason why you need to change the main form while the application is running? Could you not just use the other form as a startup object?
  15. If you close the main form for the application you effectively terminate the windows message loop. You need to tell .Net that another form should process messages and keep the application running. i.e. 'In the current main form dim f as new form1() f.show application.run(f) me.close();
  16. Could you post the SQL statement and also the table definition? It looks like you are trying to reference a column in the datareader that doesn't exist (possible typo?).
  17. When you say doesn't work - could you be a bit more specific? Also any chance you could post the relevant code?
  18. http://www.xtremedotnettalk.com/showthread.php?t=84242&highlight=webclient+text Also if you're using .Net you should look at the classes under System.IO rather than using the legacy FileOpen, LineInput functions.
  19. Nant is a build tool (bit like make) not a deployment solution. Choosing a deployment solution really depends on your requirements. The deployment wizard that ships with VS is fairly easy to use for a simple setup package but can get complex if you require a lot of customisation. Alternates like Wise, InstallShield etc can be a lot more expensive but generally give more flexability and control - like I said it depends on your requirements.
  20. You could shift the bits of one short to the left bu 16 bits then add them together ushort s1 =0xabcd, s2 = 0x1234; int i1 = (s1 << 16) + s2; //i1 now equals 0xabcd1234
  21. Dim i As Integer = 255 Dim s As String s = i.ToString("X") Console.Writeline(s)
  22. You could create a class within your project and put these functions there, this class could then be accessed from both pages.
  23. You may be better of asking VB 6 related questions over on our sister site http://www.xtremevbtalk.com/
  24. An interface defines a required set of methods / properties / events. Any class or struct that implements an interface is required to provide an implementation of ALL of these. Other code could be written that only expects to work on variables whose type is the interface, this code will then be able to work with any class or struct that implements said interface. The calling code never needs to know the specifics of how a particular class / struct decides to implement the functionality, it can just call it blindly.
  25. VS 2002 requires 1.0. the code it generates is compatible with 1.1 but you must have 1.0 installed to run VS itself.
×
×
  • Create New...