Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Windows is a SMP (symmetric multiprocessing) based system - this means threads can be scheduled on any availabe cpu (physical or virtual) by the OS regardless. Apart from one or two core OS threads which always run on the first cpu other threads can (and will) freely move between cpus based on cpu availability. Although you could (potentially) use theSetProcessAffinityMask I'm not entirely sure how this would work with .Net as the runtime is multithreaded anyway.
  2. Hashing isn't the same as encrypting though - if you need to store encrypted data then you will need to get the encryption working. Could you post the code you have so far?
  3. If I can dig it up I do have a sample knocking around somewhere (a continuation of the tutorials I will get round to finishing in the tutor's corner). It's a VB sample that dynamically loads a list of available plugins that the UI can use to display to the user and a factory that then creates the correct instance internally. Not too difficult to do either, getting the plugins designed correctly is the biggest challenge.
  4. .Net objects use what is called a strong name to identify themselves not a guid. A strong name is a combination of the assembly name, culture, version and public key used as part of the signing process. If you are not overly concerned about versioning then you can just load an assembly by filename alone, if versioning is important then the strong name can be used to ensure the correct / later versions are loaded. You could either maintain the class names between versions to prevent failures or possibly use some other structure to contain this information i.e. alongside the .dll also have a .xml file that contains information regarding the .dll to use, the class name as a minimum but you could also specify additional information like display names (if the UI needs to display things), enabled / disabled state etc.
  5. What version of asp.net are you using? If version 1 / 1.1 then you will probably need to do this via a 3rd party control like this one. If you are using version 2 then the built in menu control / sitemap data source will take care of this for you.
  6. regsvr32.exe has a /s switch for silent
  7. http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx might be worth a read (as is most of the blog) as it goes through creating a customised registration process that uses profile to store things.
  8. The XML file could contain the path to the real image file as a named attribute - however opening the xml file would just display the XML 'as is' and not the image; this is by design as XML is a storage mechanism not a display medium. If you want to be able to store data in XML and view it in a different format via a browser then you may want to look at XSLT as this will allow you to do this (as well as a lot of other things).
  9. Doesn't get how far? If it crashes on the line you mentioned then it is getting that far. Also it would fail with a NullReferenceException if it was null (which a .Text proprty can't be anyway)
  10. Using a textbox shouldn't cause any problems, if you step through the code in a debugger waht is the value of TextBox1.text before the exception is thrown?
  11. Me.SqlSelectCommand1.CommandText = "SELECT tblPRUMaster.PruID, tblPRUMaster.PruNumber, tblPRUMaster.PermitNo, " & _ "tblPRUProduction.RptDate, tblPRUProduction.NorthOrSouth, tblPRUProduction.OilProd, " & _ "tblPRUProduction.GasProd, tblPRUProduction.MonthlyAllowableOil, " & _ "tblPRUProduction.MonthlyAllowableGas FROM tblPRUMaster INNER JOIN tblPRUProduction ON " & _ "tblPRUMaster.PruID = tblPRUProduction.PruID WHERE PermitNo = @PermitNum" Me.SqlSelectCommand1.Connection = Me.SqlConnection1 Me.SelectCommand.Parameters.Add("@PermitNum", SqlDbType.Int) Me.SelectCommand.Parameters("@PermitNum").Value = Integer.Parse(TextBox1.Text) Does the above code make a difference? Also which line is the exception being raised on? If you step through the code in the debugger does TextBox1.Text contain the correct value?
  12. What is the value of textBox1 when the code errors / fails to work?
  13. Oops - I was converting the wrong post of yours - try changing the SqlType.NVarChar to SqlType.Int and see if that fixes the problem
  14. Not entirely sure what you are trying to do here. Are you trying to store a link to an image or store the actual image itself in the XML file?
  15. I've modified the original post - should work this time, however it still hasn't been tested...
  16. If the data is a number then you do not need to surround it with ' WHERE tblPRUMaster.PermitNo= " & Me.TextBox1.Text However concatenating strings like that can be a source of errors and security holes you are much better using a parameterised query instead. something like Me.SqlSelectCommand1.CommandText = "SELECT tblPRUMaster.PruID, tblPRUMaster.PruNumber, tblPRUMaster.PermitNo, tblPRUP" & _ "roduction.RptDate, tblPRUProduction.NorthOrSouth, tblPRUProduction.OilProd, tblP" & _ "RUProduction.GasProd, tblPRUProduction.MonthlyAllowableOil, tblPRUProduction.Mon" & _ "thlyAllowableGas FROM tblPRUMaster INNER JOIN tblPRUProduction ON tblPRUMaster.P" & _ "ruID = tblPRUProduction.PruID WHERE (PermitNo = @PermitNum)" Me.SqlSelectCommand1.Connection = Me.SqlConnection1 Me.SelectCommand.Parameters.Add("@PermitNum", SqlDbType.NVarChar) Me.SelectCommand.Parameters("@PermitNum").Value = TextBox1.Text I haven't ran the above so it may not be exact - however it should give you the general idea.
  17. The problem lies with the SQL - you can't just put a variable inside a string like that. The best way is to use either a stored procedure or a parameterised query - if you search these forums you should find a lot of information about this.
  18. Any chance you could post the code - much easier to see where you might be going wrong if we have something to look at.
  19. If you need to perform initalisation of your class (with or without parameterisation) then a constructor is a useful tool, otherwise you will not need to create one.
  20. Don't sleep on the UI thread is the simple answer, if the UI thread is asleep it cannot respond to any input therefore it stops responding. Ideally you would implement some other mechanism here - a timer + callback would possibly be the best choice, or you could always perform a loop with a Application.DoEvents() inside it but this is a poor technique as it can burn a lot of CPU time to do nothing at all. Out of curiosity is there a reason for the Sleep being there?
  21. In that case you may find the SendInput to be an easier API to workwith.
  22. The built in routines only search for a single value - you could however implement your own search routines that could look for multiple entries at a time but I would imagine that could get quite complex if you are implementing it correctly. Is there any reason why you couldn't just do two binary searches?
  23. Firstly change all the 'As Long' bits of your declare to 'As Integer' - that should remove the problem of it crashing. You might find it easier to just use the Button1.PerformClick() method however to simulate a button click rather than relying on SendMessage.
  24. Is there a reason why you need each form to run on it's own thread? The window only needs to respond to user actions on the app's main thread (technically it is dealing with incoming window messages) and the message pump isn't itself multithreaded. If your forms are doing cpu intensive or long running operations then they can spawn their own threads for this work. All window updates need to be performed on the application's main thread anyway otherwise you will encounter issues / runtime errors - one window running on one thread updating the state of another window on a different thread is asking for trouble.
  25. http://www.xtremedotnettalk.com/showthread.php?t=73762 http://www.xtremedotnettalk.com/showthread.php?t=95095
×
×
  • Create New...