Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. How long is your application running for? If it is only executing a short while then you will see this memory increase. Under .Net memory is reclaimed through 'Garbage Collection' and the .Net implementation is lazy by design, it will only attempt to free up memory when it believes there is a benefit in doing so. As a consequence this means it behaves in a non-deterministic way i.e. there are no guarantees as to when objects will be released from memory - only that they will eventually be freed up. The more RAM you have then you will probably notice the objects hanging around longer. As to unloading an object from itself - as far as I'm aware this isn't possible. If your object holds on to expensive resources (network socket for example) then you may want to investigate the IDisposable interface. If you feel you need to look into managing your resources more then have a look here Also a nice little tool from sysinternals can be found here with this you can see how much memory is in use, amount of time spent in garbage collector etc.
  2. Another problem with select * is that changes to underlying tables can have hard to track down side effects. Saw this happen once - overnight a particular page in a web application had gone from approx 5 seconds to about 3 minutes to display. some bright spark had used SELECT * to retreive information which was used to populate a couple of drop down lists. The amount of data returned wasn't large about 5 -10K. Cause of slowdown - somebody added a picture field to the table, the 5-10K to retrieve the entire table jumped to about 500K!
  3. http://www.xtremedotnettalk.com/showthread.php?t=83020&highlight=asp.net+hosting http://www.xtremedotnettalk.com/showthread.php?t=79904&highlight=asp.net+hosting
  4. Here's a really quick sample knocked up using the Mentalis link. Looks ugly but will read the values into textboxes and save you changes back. Works with the file layout you specified. INiFile Sample.zip
  5. Set the form's KeyPreview property to true and it should work.
  6. Rather than use the VB6 FileOpen etc. commands you would be much better off using .Net functionality (Streams, StreamReader etc.) However I notice the file looks a lot line an .ini file - if that is the case you may want to have a look here or here.
  7. SELECT TOP 10 * FROM tblName where field_name <> 0 ORDER BY NEWID()
  8. Are you databinding in your page_load event? If so are you doing the databinding on every page_load or using if not page.IsPostBack 'Databind first time end if kind of syntax?
  9. Arch4ngel, in ToniMontana's original post he said unless you know something special about the .Net framework I hardly think these activities count as
  10. If the client has the Microsoft Data Access components installed (get them here) then you shouldn't require the access runtime to be installed.
  11. Unsafe code does get garbage collected, you just have to follow a few rules before you are allowed to use memory in this way. Unsafe refers to the fact that you are calling code from outside the .Net managed environment and as such the .Net security policies cannot be applied and the resulting IL cannot be verified i.e. it may do unexpected (possibly illeagal operations) things. If the code attempts to do things the .Net application doesn't have permission to do then there is nothing to stop it executing.
  12. what happens if you remove the line contents.Replace(vbCrLf, System.Environment.NewLine)
  13. Which line of code actually generates the error? It may be a problem instantiating an instance of word.exe. I think you will need to grant permissions for aspnet to launch the application. If you are running XP (and I think win2k and win2003) this should work. Start->Run->dcomcnfg - this should launch the component services tool. Drill down to the correct computer and select DCOM config. Look for the package that corresponds to MS Word (think it is called either 'Microsoft Document' or 'Microsoft Word Document'). Right click on it and bring up the property pages, then go to the security tab. Under launch permissions select customize and then edit. Finally add in the \ASPNET account. Not 100% on all of the above (don't have word or VS installed here) but it should be close enough to get you looking in the right direction.
  14. The problem is it is waiting for the readline to return before it can process any further commands. Not sure if there is a better way but I've just hacked a quick fix together.... Sub Main() Dim ni As New System.Windows.Forms.NotifyIcon ni.Icon = New System.Drawing.Icon("..\Face01.ico") ni.Visible = True AddHandler ni.Click, AddressOf Clicked System.Windows.Forms.Application.Run() End Sub Private Sub Clicked(ByVal sender As Object, ByVal e As EventArgs) Console.WriteLine("Click") End Sub
  15. If you are using COM components then either they need to already be present on the target machine, or you will need to create a deployment project that will deploy and register the required files if you are legally allowed to do so. If the components are part of another software package i.e. office then the destination machine will need a licensed copy of the software already installed.
  16. If you use a hashtable rather than a collection it has two methods - ContainsValue and ContainsKey -these may be a bit easier.
  17. Do you have a variable called threadid declared in the current function / class
  18. Add a reference to both System.windows.Forms and System.Drawing. Just tried with a new project - only entered the following code and it worked. Dim ni As New System.Windows.Forms.NotifyIcon ni.Icon = New System.Drawing.Icon("..\Face01.ico") ni.Visible = True Console.ReadLine() Just change Face01.ico to whatever your icon is.
  19. When you try to create a new project what options are you given? Which of the project templates did you choose? When you say the option to add a windows form isn't there what options are present?
  20. Any hints as to what you mean by 'doesn't seem to be working'? Does it give any errors? Does the file exist? Is anything else using the file?
  21. If you are referencing a .Net DLL could you not just put it in the same folders as the EXE or failing that why not install the DLL to the GAC?
  22. Are the field and table names spelled correctly (a favourite mistake of mine ;)). Also if you are stepping through the code which line actually causes the nullreferenceexception?
  23. Have you tried SELECT * FROM Car WHERE Name_car LIKE '%" & TextBox1.Text & "%'" If not what text does the message box display?
  24. Have you set ws to a valid instance of the web service?
  25. Don't see how they could stop you. After all any code you write is your IP. There are numerous web sites with open source stuff on them,
×
×
  • Create New...