Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. What does that particular line look like?
  2. No, the object will be Finalised whenever the GC kicks in next.
  3. IIRC the FindByText is case sensitive and only does matching of entire strings. Probably the easiest method is to loop through the items and compare each string one at a time.
  4. When you inherit from a class you do not inherit it's constructors - you would need to provide the relevant ones for the AdvancedAccount class; these could simply call the base classes version though.
  5. As you are using .Net 2 then you might want to investigate generics as an alternative to both arrays / HashTables.
  6. Does the ASPNET account have permissions to the Z:\afbeeldingen folder?
  7. The Dir function is really a legacy VB function (and it wasn't that good then) - Try using the classes under System.IO. e.g. If System.IO.File.Exists("z:\images\" & pItem & ".jpg")
  8. The best way to signal an error is just by using exceptions. If the routine you are calling has handled the error why does the calling routine need to know? If on the other hand the called routine isn't handling the exception then it shouldn't be catching it. As a rule you should use parameters for passing information into a routine and a return value for returning a result. If there is an unhandled error then signal this by either throwing an exception or just allowing the exception to propagate up the call stack.
  9. If it doesn't appear in the list you should just be able to type in the namespace.classname in the textbox.
  10. Graphics.MeasureString should be able to tell you what you need.
  11. Split from http://www.xtremedotnettalk.com/showthread.php?t=97057 to keep the original threads intention intact. Nothing wrong with a bit of discussion though so I'll leave these comments here.
  12. Are the two web services essentially the same but hosted on different URLs? If so you could just create a single web reference and then either change it's type to dynamic (from the properties window) which will allow you to edit the .config file and specify a url. Alternatively you could just set the URL property of the webservice at runtime to the correct service. Generally speaking I would also suggest turning Option Strict On for VB projects and avoiding late binding altogether if possible.
  13. One thing you can do with the CLRProfiler is add a reference to it from your app (remove it in release builds) and actually insert commetns into the log file - this can be a big help in seeing what is happening over time. Without seeing the code itself it is difficult to know what the problem(s) is (are) if any. If possible could you attach a zipped version of the profiler log and I'll try to find time to have a look at it.
  14. Some of the ideas mentioned in http://www.xtremedotnettalk.com/showthread.php?t=90123 may be worth looking at. In terms of getting memory usage you could always use the performance monitor counters to get at the running values.
  15. http://www.microsoft.com/downloads/details.aspx?familyid=86ce6052-d7f4-4aeb-9b7a-94635beebdda&displaylang=en is your friend.
  16. I personally find that can work very well if you remove the paper bit from it ;) Rather than relying on physical documents, which cause problems with multiple revisions being in circulation etc, a more on-line form such as a wiki or a SharePoint system works well. An Intranet based system means everyone always knows where the current version is, and more importantly if using something like a wiki or sharepoint all previous versions can be maintained and viewed. This makes tracking changes etc. far easier. Couple this with basic security to limit who can make changes as opposed to who can suggest changes and you can end up with a very workable system. If this also includes basic bug / incident tracking then you have a single place for all relevant information that can be linked using the magic of a href - no more manually searching for related documents base on arbitrary document name / numbers. When it comes to TDD Unit tests provide two main functions in software development, firstly they do provide a way to reliably and continuously test software during the development cycle; a side effect of this is the ability to perform code refactoring with an enhanced degree of confidence. The second thing they provide is a definitive 'specification' for the software by removing any ambiguity. If you cannot read part of a more formal specification and then generate one or more tests that can be used to prove the validity of the code (about to be?) written then the specification either isn't clear enough or has failed to consider all possibilities. Once written (and like any written code), reviewed, refactored and repeated these become a 'specification' that is much easier to read when in developer mode - you do not have to interpret meaning from wordy documents, you can read code and associated comments to understand the requirements. Any kind of non-confrontational review is something to be applauded IMHO; in fact as well as a more formal review of junior developers code by senior developers I would encourage a more informal peer review system. If more than one junior developer sees a piece of code then no one developer is essential; if they leave for whatever reason at least one other developer is passingly familiar with their existing code. Reviewing each others code does provide a valuable glimpse into other parts of the system and fosters a more general understanding of the system as a whole, while also tending to provide a more consistent coding standard without always needing the 'big stick' approach. Ultimately I think sucessful sharing of knowledge is a combination of multiple actual methods, but more importantly a good mixture of good people. If people are keen and the chosen tools work information will spread. Idiots, egotists and people unwilling to share or change need to be removed as these are often a cause in information failing to propagate... And finally congratulations Nerseus - looks like your hard work has paid off :)
  17. How are you building and executing the string? If you run the string directly against the db (Query Analyzer) what happens?
  18. For some background reading (a series of 5 parts) http://blogs.msdn.com/oldnewthing/archive/2005/10/10/479124.aspx http://blogs.msdn.com/oldnewthing/archive/2005/10/11/479587.aspx http://blogs.msdn.com/oldnewthing/archive/2005/10/12/480064.aspx http://blogs.msdn.com/oldnewthing/archive/2005/10/13/480569.aspx http://blogs.msdn.com/oldnewthing/archive/2005/10/14/481043.aspx I think this is a case where they know there is a potential problem and that it can be quite subtle; in the past they have published guidelines and those have been ignored, making the tools default to a 'best practice' will at least make people aware of the issue. When it comes to which properties / methods do and don't require invoking the safest approach is to assume all need invoking. You may get away with them in testing or on particular hardware platforms but sooner or later you run the risk of getting burnt, the increase in dual-core systems is only going to increase the potential of a problem occurring.
  19. Edit: Ignore this - I didn't read the quesion properly :( Not really an answer this - why are you needing to cast the interface back into a particular class? Couldn't you just do MessageBox.Show("Employee " & manager.Id & " has been updated.", "Employee Updated")
  20. http://www.grahamwideman.com/gw/tech/dataacq/wintiming.htm http://discuss.fogcreek.com/joelonsoftware3/default.asp?cmd=show&ixPost=85520 http://www.microsoft.com/whdc/system/CEC/mm-timer.mspx Are worth a look as they give some good background information regarding timers and precision plus some suggested alternatives.
  21. You don't. The users sql login and password never enter into things.
  22. If the users are longing into your website then that is how you identify them. All your security is based around the user and associated groups used by the website. These may be windows based if you are using windows authentication, however this could be your own security model implemented as Forms authentication. Regardless of how they login to the site only a single user (the web application itself) ever accesses the database. SQL Logins and windows accounts are completely separate concepts and don't overlap.
  23. Out of interest what kind of difference in times are you noticing?
  24. If you want (perhaps 'are being forced' is a better phrase) to use sql authentication then you will need to generate a connection string for every user. If the information they provide to your login screen matches their sql account then you will be able to build the correct connection string. If the information is different then you will have to prompt them for that as well, annoying and invariably going to cause confusion and misery. Best thing is if you manage to get this working you will be rewarded for your efforts by worse performance and increased load on your SQL Server. Bonus! The main reason for the performance impact is creating a connection per user per database effectively prevents ASP being able to pool the connections. Ideally you want to validate the user at the website level and based on that decide what they can and can't do, all data access is done under the single account used by the ASP application.
  25. '.Net 2.0 Dim host As String host = System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName '.Net 1 Dim host As String host = System.Net.Dns.GetHostByAddress(Request.UserHostAddress) The variable host should contain the fully qualified domain name - the country might be obtainable from parsing this out. Be aware this is not 100% (probably nowhere near in fact.) You might find a better solution is to run a WHOIS query agains the IP address - http://www.vbdotnetheaven.com/UploadFile/jghosh/WhoIsQuery04182005050349AM/WhoIsQuery.aspx?ArticleID=63b59267-40fc-40d4-b724-df0d77dbef97 has a sample that might help.
×
×
  • Create New...