Jump to content
Xtreme .Net Talk

bri189a

Avatar/Signature
  • Posts

    1014
  • Joined

  • Last visited

Everything posted by bri189a

  1. You can't add directly to the .NET string class and it's a sealed class so you can't extend it by creating a derived class. Generally there is no need to extend native types such as this. For instance, why would a windows application care about a URL? Or console app? Or a class library? Just create a helper class with a static method that does this URL thing you want to do.
  2. Hey folks - getting the right font from the customer is always a pain for me (I like the ones that leave that petty detail to their system globalization - but some aren't so easy and get really detailed about exactly what they want rather than focusing on what the system should do) but I digress - so I have a sampler I put together that any of you can use - it's pretty basic, but perhaps it will help you, as it has helped me, get the font-style a customer wants finalized. In trade I've never had to worry about a page that was so static that I would use cache techniques (my 9-5 job has extremely fluid pages), so I never got into how to properly use the OutputCache directive. This page is obviously very static. Playing with it all I manage to do was get the page to always show up at 22px font size no matter what font size I picked. So a quick lesson there would be great - vary by param seems to have to use query strings - the drop down list is auto post back so there is no query string. If anyone has any additional font styles (that aren't obscure and require special installation for most PCs) send me the font names in a PM and I'll add them to the data set. The ones there now are just from my PC and the server. Thanks. http://www.autumnhaze.org/Fonts.aspx
  3. I agree whole heartedly that a good design is what makes an application scalable. However not all people realize this. Thanks for the article. I found that earlier. Found some good through-put and response time measurements too and lines of code comparission. Any major companies that use .NET, or pre-package enterprise solutions that are built on .NET is kind of what I'm looking for now for comparission sake.
  4. I need examples of large well know applications (enterprise software) written in .NET that demonstrate it's scalability, portability, etc. and any articles that compare it to Java (in the good light). I have people who are under the impression that .NET is not scalable, and is not a good enterprise solution (or cabaple of being one), and that Java is the better technology (even though we have 0 java developers besides the little bit me and a few others know). I need, links, numbers, and articles that are cold hard facts (not opinionated). I'm googling but I'm not sure what to google for. Thanks for your help!
  5. In code (on PreRender): Page.RegisterStartUpScript("Init", "InitVars('" + this.txtInput1.ClientID + "'"); In Page: <script language="javascript" type="text/javascript"> var inputIDElement; function InitVars(id) { inputIDElement = document.getElementById(id); } function SomeOtherFunction { if(inputIDElement) inputIDElement.Text = 'asdf'; } </script> My syntax may be off since I'm going by memory. NOTE: Sometimes because of the parent control (container) I have use UniqueID - but usually ClientID will work fine.
  6. Beauty is in the eye of the beholder, but I'd check out a book at Amazon that speaks of the subject or look at other web sites that appeal to you and do the same thing.
  7. I rarely disagree with PlausiblyDamp, but I wouldn't recommend the DataApplication block or anything out of Enterprise Library. It's extremely bloated and the new version will try to write an entry into the registry if it wasn't installed on the host machine (the error handling block) - which won't happen on a shared environment - trust me, learned that one by experiance. Also I wrote my own DataApplication block which doesn't have all the nice GUI for the config file, but provides a (IMHO) better factory pattern (one that follows the GoF pattern) and is only about 1/10th the size of an assembly. Definitely agree though to use a seperate data access layer.
  8. So I was reading that you should make sure to dispose any DataSet or DataView object on the Page_Unload event since they tie up resources and they won't be disposed otherwise - it will have to wait until GC gets around to Finalizing the object. Simple enough - makes since until: If you keep the DataView or DataSet in Session so you don't have to go through your data access classes and hit the database each time, you now have a potential problem. When you put a DataView or DataSet in Session it's put by reference (it's an object). So if you have: In the fields: WithEvents ds as DataSet In a function somewhere: SomeDataAdapter.Fills(ds) Session("Whatever") = ds ds.Tables.Clear() And in a later function: Dim dt as DataTable = DirectCast(Session("Whatever"), DataSet).Tables(0) You will get a null reference. So..... If you dispose a DataSet or DataView that you have as an object on your page that you may set from Session or ViewState after initial load, and then in your Page_Unload event you're trying to Dispose that object, which because of the reference be trying to dispose an object in Session... which for one, can that even be done, and two, would that cause GC to re-register it for Finalize, and three if that occurs now it would live in Session until Session died because it's not in the fReachable queue (able to be finalized because it's not tied to any other objects). Am I correct in all of this or am I way off?
  9. I traditionally on things like this have a start up script that sets a variable that is used by the javascript function that does the work - the variable being the id of the element to get with the getElementById function. In the startup script I pass the ClientID so that javascript knows the correct ID.
  10. You could use a table or a div tag and set the width dynamically using javascript and the availWidth function of the DOM. Then set the height to whatever you want. And using the background-image style attribute to set the image itself.
  11. I have no code that is explicitly do anything weird, does anyone know why it would be called twice (only when redirecting or transferring to another page - otherwise only gets called once as expected).
  12. I agree with that logic, however the folks who maintain the web server don't feel that way, I'll have to do some follow up testing.
  13. I read about CLRProfiler while I was reading up on the detail of GC last night...have it on my list of downloads for Monday. I'm testing single user (unit testing) on my local box which as 1GB of RAM.
  14. So I read some great aritcles on MSDN about garbage collection - have a better understanding now and I went to do some expierments. I was always under the impression that ASPNET_WP calls dispose on the code behind Page class and being a naming container it would dispose all of it's children. I did some Debug.WriteLine in the Dispose event and it's never called. It's no wonder in my other post that memory increases expedentially. Is this by design? I don't understand why it would do this. I guess maybe it could be on a differant thread, but would that keep the Debug.WriteLine from being visible??? I'm confused, what I though I knew I don't, maybe I'm over thinking tonight. :/
  15. It would be far simpler to point you to the sources of my knowledge than to write the paragraphs it would take to explain: http://www.google.com/search?hl=en&lr=&q=site%3Amsdn.microsoft.com+DataSet+Cascade+Update&btnG=Search http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataruleclasstopic.asp http://msdn.microsoft.com/msdnmag/issues/02/11/DataPoints/ http://www.functionx.com/vbnet/adonet/relationships.htm http://www.google.com/search?hl=en&q=DataSet+Cascade+Update&btnG=Google+Search
  16. This app I'm working on seems to just have a huge footprint and GC doesn't seem to do it's job properly: Most pages aren't too big, but there are some that have a datagrid in it with 100+ columns and 1000+ rows (should the user choose those options); so granted, it should take a lot of memory to render all of that, but it can peak up to around 300MB with a single user - which just seems insane. GC will come along and drop it to 140M at best on it's on. If I explicitly GC on the end of every page (regardless of the page) my footprint can drop down to 80M at best and never gets over 220M between postback and render (before I explicitly call GC). Something seems very wrong about this. Why if I explicitly call GC over and over again I can free up more memory than if I let GC work on its own. I know it's not a good idea to manually call GC so obviously there's a problem that needs to be fixed. This app is very large, so I can accept the footprint not droping below 80M if there's a valid reason - but I just can't see one... we never load 'all' the classes in one trip to the server, at that's the only way I can see it getting that large. I wish there was a way (and maybe there is and I just don't know about it) to view the objects in memory so I could determine what's taking up all the space. I've noticed most of the memory chunk gets created during render (understandably), but it seems like part of that chunk gets left over and never gets cleaned up, like large datagrids aren't being disposed when the page is disposed or something. Any tools or advice for analyzing this type of thing would be great to know about. Thanks.
  17. On this site: http://www.xtremedotnettalk.com/showthread.php?t=49319 In fact they have a whole section on it Eslewhere: http://www.codeproject.com/aspnet/createTextImage.asp http://www.codeproject.com/aspnet/imgant.asp http://aspnet.4guysfromrolla.com/articles/072804-1.aspx http://aspnet.4guysfromrolla.com/articles/081104-1.aspx http://aspnet.4guysfromrolla.com/articles/081303-1.aspx http://www.c-sharpcorner.com/2/gdi_plus. and the most important one if all else fails (and where most people start): http://www.google.com/search?hl=en&q=GDI%2B&btnG=Google+Search Google is your best friend.
  18. Again, it's what you're good at. I could do that in flash, DHTML, whatever. You should always program at a level slightly above your comfort level. I say above because if you only program at your comfort level you never improve. It it were me doing it I would just doing it with plain old ASP.NET (since I can manipulate GDI+ to do some cool graphic things, and my javascript skill are pretty good for the dragging and dropping), but for yourself, if Flash is more comfortable, do it in flash.
  19. Good design. That's not a simple question. There is no simple answer. That's like what make a good car? It seats a lot? Maybe to some. It's fast? What is fast? 80 mph? 120 kph? It has loads of safety features? Good design is in the eyes of the beholder. The best you can do is make a design that is good to you and hope that what you like, other people like. Or make the site look like what other sites people like look like.
  20. You could find out about the assembly version, possibly the culture, and other things that are assembly specific. You could also findout the types within the assembly, the methods, properties, and attributes of each type in the assembly. If a type has a field named description, you could find that out- but I don't think anybody would do that.
  21. What is arrGrid just another Square[]? and is Square a Class or a Struct?
  22. Flash, is well, flashy. It's extremely slow on dial up, and it requires an uplevel (newer) browser with the correct plugins and it's speed is based upon the client's machine - it can be very fast on one machine and very slow on another. Is there anything you can do in flash that you can't do with SVG, or CSS, or JavaScript, or rather a combination - no - is it easier HTML? Depends on you're experiance level with both (ASP.NET/PHP fall within HTML because that is what they render). Flash is just one product made by Macromedia - they make several web development products. I use none of them and I do this for a living. Chrome plating doesn't make a good car. The same can be said for Flash and a good web site.
  23. A dataset should map to the business process being solved not the ERD if this company is of any size. Unless this is a new company, if the ERD is modeled after a business process then a dba should be fired, if the dataset matches the ERD then the developer should be fired. A table in the database may only have 3 or 4 columns out 40 that you are interested in for you're business process. It a waste of bandwidth and memory to track those other 36 columns. Its very rare that a business process follows an ERD diagram (unless it's a small project or a small/start up company) - there may be similiarities, but the more complex the company, the further from similiarities between the database ERD and dataset layout you should be. As far as your question. If when you created the dataset you had on Update/Delete/Insert being cascading events then the insert statement for each table will be called. If you don't then, yes you'll need a big ugly insert/update command.
  24. I think you're best bet (because IIRC Access doesn't support transactions, and even if it did, in this case it's a bad design), is to use a DataSet. If you're dataset has the original records, as you modify them the rows will change to 'changed' or 'added' or 'deleted'. Then if you want things to be really easy, you just have a data adapter that has the correct UPDATE, DELETE, and INSERT commands and when they're ready to save you do a DataAdapter.Update() method which will call the proper stored procedure for each row that has a state change. Prior to that anytime before they hit save they can cancel changes for a row or for everything (this is done by DataSet.RejectChanges()...) but any changes they have made up until that point will appear to the user to be saved because the dataset holds the current changes until they save to the database (the data adapter will do DataSet.AcceptChanges() when it is completed (successfully) doing the Update() method). DataSets are a perfect fit for this kind of issues - working with disconnected data and only updating the data store at a designated time.
  25. Hope you left a comment on the MSDN page of the error, but thanks for discovering the error, I'll definitely stick that one in my head for when I one in to the same thing! :)
×
×
  • Create New...