Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Try dateTemp = Date.Parse(txt_beginning.Text) or failing that have a look in MSDN for the ParseExact method.
  2. http://www.go-mono.com/faq.html#compatibility
  3. Does the other computer have Excel installed on it? Also does the file exist in the correct place? If you go to start->run and type in the path does excel open the correct file?
  4. If the StreamWritter isn't used anywhere else then I would recomend closing it - otherwise it would remain open effectively locking the file till the application was shut down.
  5. Could you show a bit more of the code? How are you reading the value from the DatetimePicker etc.
  6. Dim s As String = "ABC123 - This is a test" Dim result As String = s.Substring(0, s.IndexOf("-"))
  7. Anything developed in .Net will require the .Net runtime.
  8. I've never come across a way of doing this myself, in fact this topic has been discused on these boards a couple of times now and no solution has been mentioned. What application are you trying to launch?
  9. The application will be running as the aspnet account and as such will not be visible to the end user. What are you trying to acheive - there may be an alternate way.
  10. You could also investigate using multiple threads - the class could do the calculations in the background and the forms could show the results as they were generated - it may be a pain if the user changes something but it would be better for them if they could see it going wrong, fix and restart early on rather than having to wait for the entire process to finish before they know there was a problem.
  11. I think Robby meant he would write a class that encapsulated His Database logic for a particular system - not a class that would encapsulate all database access.
  12. If the order they fire in is important you will probably be better of using the AddHandler command. Private Sub Click1(ByVal sender As System.Object, ByVal e As System.EventArgs) MsgBox("Event 1 Fired.") End Sub Private Sub Click2(ByVal sender As System.Object, ByVal e As System.EventArgs) MsgBox("Event 2 Fired.") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Addhandler Button1.Click, Addressof Click1 Addhandler Button1.Click, Addressof Click2 End Sub
  13. probably something like objguia.Tables("YourTable").Columns("gia").ColumnMapping = MappingType.Hidden
  14. Storing the data in it's own class will probably give you more flexability. If you require different ways of charting / displaying the data you can simply add new forms and get them all to reference the class rather than combining the calculation and output code in one place.
  15. Dosomething has it's parameter typed to BaseClass - so it calls the BaseClass version. A function marked as Shadows in a SubClass does not get the SubClass' version called - that's what overridable / overrides is there for.
  16. Have you added a reference to the System.Management dll?
  17. How about one table with the player details linked to a table with the player stats?
  18. How are you converting the dataset to XML? Any chance of the exact error message?
  19. Shadows will hide the BaseClass version of the function from the sub class and sub-classes of it, and calling it from a variable declared as the BaseClass will result in the BaseClass version being called. Overrides will result in the SubClasses version being called.
  20. Which line are you getting that error on?
  21. Seven lines of code is overkill?
  22. probably your best bet is to look at the eventargs passed in. IIRC e.Data is where you will find the source control info.
  23. DataSets have a ReadXML method you could use to get the data into the dataset, you should then be able to use a DataAdapter to update the database.
  24. Although a SubClass IS A Type of BaseClass the reverse is not true. You cannot declare a variable of type subclass and make it equal to a base class if you change the button event code to the following you will see where it fails to compile Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim baseC As BaseClass baseC = new BaseClass() 'will work baseC.ShadowNoise() baseC.OverrideNoise() baseC = New SubClass() 'will work baseC.ShadowNoise() baseC.OverrideNoise() Dim subC as SubClass subC = New SubClass() 'will work subC.ShadowNoise() subC.OverrideNoise() subC = New BaseClass() 'Error End Sub [code=visualbasic] Now if I was being a bit more structured rather than putting the declarations into the event handler direct I could have used a sub routine. Based on the original sample replace the button click with the following and notice the results as you step through with a debugger. [code=visualbasic] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim bc As New BaseClass() DosomeThing(bc) Dim sc As New SubClass() DosomeThing(sc) End Sub Private Sub DosomeThing(ByVal c As BaseClass) c.ShadowNoise() c.OverrideNoise() End Sub If that works try changing the function definition to Private Sub DosomeThing(ByVal c As SubClass) and see what happens then.
  25. Yes the latter includes all the base class functionality as well. However by declaring a variable as the BaseClass means it can contain the BaseClass or any class that inherits from the base - why write code that is limitted to only working with the sub class if I can write code that works with the base class or the sub class? In the example I gave the decision to be a subclass or a baseclass could be made on run-time criteria, the code would work without having to know exactly which class it was working with.
×
×
  • Create New...