CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Steve Hebert's Development Blog

Steve's Blog - From .Net to dotMath and everything in between.

April 2005 - Posts

  • Tracking down a rogue Data Connection in Server Explorer

    I've had an annoying problem with a data connection appearing under the "Data Connections" node in Server Explorer under VS2003.  Everytime I load up my project, I get prompted for a Sql Server Login to a particular database. Worse yet, this popup kills the progress of my daily build process.

    Every time I deleted the connection, it would reappear on reload of my project.  Doing mass searches inside and outside of the IDE turned up nothing.  I figured this must be a project level issue, so I popped open the database project file (.dbp) and there lives the DBRefFolder section and looks like this...

       Begin DBRefFolder = "Database References"
          Begin DBRefNode = "servername.databasename"
             ConnectStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;Initial Catalog=myDB;Data Source=servername;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=mongo;Use Encryption for Data=False;Tag with column collation when possible=False"
             Colorizer = 5
          End
       End

    So here is how this undocumented monstrocity works... upon loading of the project file, the contents of the DBRefFolder are loaded into the DataConnections node under Server Explorer.   

    This is extremely annoying and somewhat maddening considering I haven't been able to find any documentation about it on MSDN (is that really surprising?) and only two references to DBRefFolder on Google.  In the bigger picture, the "Database Project" under VS.NET (2002 and 2003) has been treated like an ugly stepchild - there is very little documentation and no support whatsoever within the Visual Studio control API.  It's really an ugly project type that ignores the XML formatting of new projects and looks and feels like an old VB5 or VB6 project file.

  • off-topic: Kung Fu Hustle

    My wife and I went to see Steven Chow's Kung Fu Hustle this weekend.  We really went into it not knowing what to expect, we heard some glowing recommendations but we also saw some reviews that said it was not very good.

    We thoroughly enjoyed the movie - it's one of the most entertaining movies I have seen in a long time.  The entire movie is subtitled, but you forget that you're reading the dialog after 15 minutes or so.  The movie is every bit as campy as the old 70's kung fu movies, but it has Matrix-style special effects.  The film has a ton of tongue in cheek humor and manages to poke fun at itself along the way.  My wife argued that the film should have been dubbed to create the true effect of the old movies, but there's one great dialog joke that could only be done with subtitles.

    Movies tend to be so dark these days and take themselves all too seriously.  This show bucks both of those trends, pulls it off and even throws in a great cheesy ending to boot.  I thoroughly enjoyed this movie.

  • Microsoft's 'awareness' of Intersoft products

     A coworker of mine pointed out an article on Intersoft's support board discussing their approach to integrating with ASP.NET 2.0.  The company has said they will wait for the actual release to port their products which is unfortunate.  As part of the discussion, the person who posted the note mentioned spending time at Microsoft's compatibility lab in Redmond.  While the Microsoft employees were familiar with some 3rd party ASP.NET grids (Infragistics and others), they were not aware of the Intersoft products including WebGrid.NET. 

    I think this lack of awareness is unfortunate as the Intersoft WebGrid is doing some things with ASP.NET that are pretty cutting edge - namely the OnTheFly Postback capability.  The product has received excellent reviews with its only criticism being that it's an IE-only solution.  However, that is changing now that they are rolling out a Gecko-compatible solution.  While I wouldn't expect Microsoft employees to be aware of the entire market-place, I always find that keeping an eye on the 'edges' of  markets where people are doing things fundamentally different than anyone else is important because 5-10% (personal guess) of what they do is a reflection of what will be mainstreamed in the future. Intersoft is pretty tight-lipped around the design they have implemented, but from what I've seen it's a fundamental piece of plumbing that can be applied to a large number of control scenarios. 


  • Dear Microsoft... please abolish in-memory session state.. Thank you.

    I'm generally not a fan of cork-on-a-fork approaches to protecting programmers, but here's one case where I think everyone could benefit...

    I've heard of too many ASP.NET web projects that rely on in-memory session state when they make the transition from beta to 1.0 and they are killed by open connections.  Here's some background if you aren't aware of the situation. If the project has session state saved to a database or state server, the ASPNET worker process can be recycled according to a host of criteria and session state is maintained without the users being aware of any problems.  When session state is saved in-process on the ASPNET worker process, recycling the hung process terminates all session and the users are suddenly returned to their login screen (presuming your logic handles terminated sessions correctly).  Open connections can be caused by database objects that have not been properly .Dispose()d in light of the latency introduced by garbage collection.  Too many open connections brings the database server and, consequently, the web server to its knees.

    In-memory session state is great for throwing together a demo and working on your laptop, but any real web project should never be using in-memory session state.  Starting any web project coding, this would be on my top 5 list of things to do.  That said, you can run a project with in-memory state activated and it works fine if the code is fully tested (includes memory profiling and execution of test suites) - but the risks you take impact the managability of the running product. 

    Bottom line... given that Microsoft is shipping products like MSDE and eventually SQL Server 2k5 express for free, make it the default and throw away in-memory session state altogether.

  • The Compact Framework jump and changing my home setup.

     I'm finally digging into the Compact Framework and doing some digging on setting up my environment to make it feasible at home.  I haven't touched the CE space in a while and only used the C++ 3.0 compiler for CE at that.  My biggest questions are (1) machine setup and (2) development environment.

    For machine setup, I'm looking at expanding my home desktop to a dual-processor unit.  This would allow me to run the CF development environment on a dedicated processor under Virtual PC with plenty of RAM.  I like the virtual PC setup, but I've always wanted more horsepower for running stuff like VS2k5 and Sql2k5 - I think I can finally justify this.  I'm looking at the MSI board for a dual opteron or AMD 64 chips, probably going with the dual Opteron chips. I'm a little leary of the board because TomsHardware points out that this board has a problem with some SysMark benchmarks back in 2004 when overclocked - but it should be fine in stock mode.  This is definitely less expensive than going with the Xeon processors. I figure if I can run with 1 GB or 1.5GB of RAM I'll be just fine (for now).

    Next, I want to drive the compact framework development using NUnit.  I think the benefits of NUnit-style tests along with memory profiling on these devices will be even more useful given the constraints of the operating environment.  I did some digging and found a couple pieces worth looking at:

    I'm looking foward to this, I'll blog some bits as I move forward.  If you have any recommendations on these setups or resources to look for, please drop a comment!

More Posts