Archives

Archives / 2004 / February
  • Debugging the Debugger?

    Tonight I ran across a small problem with the C# debugger, or rather the Command Window in VS.NET.  While stepping through my application (more to come for this) to determine where a slowness was occuring while reading the registry, I tried several different commands in the Command Window.  When doing so, I think I've found a bug in how it interprets commands.

    I input:

    regKey.GetValue(keyValue, "").ToString()

    and what I received was:

    error: 'regKey.GetValue(key, "".ToString' does not exist

    Its quite obvious it couldn't parse what it interpreted, only because ITS WRONG!  Anyone have any ideas?

    Read more...

  • Another VS.NET Irk

    Heres another little thing that VS.NET does that irks me.  Whenever I'm copying and pasting HTML code in the code editor, VS.NET seems to think that if I don't have a ID or Name attribute, that it should add one.  I wish the IDE could be a bit smarter to think that if I didn't have it before, I wouldn't want one now.  Also...why does the IDE think that I want a Name attribute anyways.  How often do you use that attribute...NONE!  Well, at least for me...I know it has its purposes, but I'm just complaining because the IDE isn't that smart.

    So - Whidbey team... can this be done?  I don't know how many times I've had to clean up my code after pasting...it shouldn't have to take me this long.

    Read more...

  • Good Uses for Empty Array Declarations

    While working on my companies new intranet, I've decided to pull some of our existing pages that are "Classic" ASP based, into the .NET realm.  In doing so, I need to gain access to our staff information from a SQL Server Database.  Since no stored procedures were ever used, and I don't have the security level to create any, I needed to build some queries that will retrieve the data I wished.

    I decided that I would develop 1 Data Access Layer method that would take in a string array of departmental codes used.  This would allow my Business Logic Layer to have N number of methods that could retrieve staff data based on 1-N departments, or just retrieving all staff. Well, since I don't know all the departmental codes currently, and don't want to re-program the thing when a new department is added, I decided to make a clause in the DAL method that will execute a query with no deparment checking.

    However, to do this, I needed to pass in a empty string array. To much amazement by me, the .NET framework (or maybe just C#) allowed me to do just that.  By using the code -- new string[0] {} -- I was able to compile and call the DAL method with success.  Interesting as this is, I started to think what other uses besides this do declaring empty arrays actually have.  Have you ever used this type of declaration before, if so why?

    Read more...

  • Interesting Tidbit

    This afternoon I decided to bring my company's intranet into the .NET world.  The current setup has an XML Document with a XSLT tranformation to build the listing of hidden/visible hiearchy.  I wanted to make the move as easy as I could, so I remembered ASP.NET contained a XML Server Control that allowed you to display XML Data transformed by XSL/XSLT.  Very cool indeed, but this isn't what I'm really stoked about.

    After remembering that this site can be hit many, many, many times a day...I wanted to use Caching to store the XML document so it would be much easier on the server.  So, I decided I would make a sub-class control of the Xml control that would handle the caching for me.  Well, after digging into Reflector to determine which method I would need to override to enable caching...I stumbled across a few Cache objects when loading the XML and XSLT documents into their appropriate objects.

    I was just stunned to see that this had already been thought of, good to see the ASP.NET team is on top of things!  However, I did waste about 15 min of my time by not knowing this...maybe I just overlooked some documentation that already stated this.  Either way, very cool indeedy.

    Read more...

  • I love Master Pages

    The past several days, I've been preparing my company's websites and connecting applications for our upcomming name change. I've never realized how much of a pain it is to change sites layout, colors, etc. until I had to modify a .NET application of ours we released a few months ago.  I had to manually touch, at least, 50 various .ASPX and .ASCX files to get the new look and feel to propogate throughout the entire application. Talk about a pain in the butt.

    So, I decided to create the new website using Metabuilders Master Pages control (site seems to be down, btw).  Let me tell you, one application I moved over (that I put together about 2 weeks ago using MP) was easily migrated to the new look and feel within an hour, rather than several days.  Master Pages is definately one of the biggest things I'm looking forward to having in ASP.NET 2.0, as it will make websites easier to manage when these sort of things come up.

    Thanks for a great free control Andy!

    Read more...

  • DataGrid's GridLines Property

    <rant>
    I really wish that the default value for the GridLines property on the DataGrid (and possibly Repeater/DataList) was set to "None" and not "Both".  I mean, I can see the reason for having this if someone wanted to just plop some data on a webpage, and didn't care about formatting or defining their own columns.  But, for about 99% of the time, developers have to build the Columns manually, set styles, etc. etc. until it looks the way we want it.  I've never seen a DG in production that has GridLines, mainly because it just looks plain stupid with custom formatting.

    So, why do we have to write GridLines="None" every time we build a DataGrid just to suffice that 1% of users that don't give a crap about formatting or are just showing the powerful use of the DG without writing a bunch of code?  ARRH!
    </rant>

    Read more...

  • ADO.NET Irks Me

    There is one thing in ADO.NET that just irks me, and well its not by .NET design.  During a lot of our Business Logic methods in our projects at work, we have to call Insert, Update, and Select procedures from SQL Server.  Of course, the proper way of doing this is by wrapping your logic in a transactional support manner... no biggie, we've got this working, and I might add, it works SUPERBLY!  Well, that is, if you remember that each call to the database while in a transaction must use the same connection and transaction.

    I'm not really sure how many times I've done this, but there's been a few that I'm aware of, one of which was today.  The BLL method calls some Inserts, some Updates, then it needs to retrieve some data to do more Inserts and Updates.  Well, for that 1 select query I ran, I forgot to pass in the connection and transaction objects.  I couldn't figure out why the app was just hanging time and time again until it dawned on me. Yup, thats right...it was a good smack my head kinda realization.

    So I guess the point of this rant is if you're using .NET transactional support with databases, make sure that every call to the database has the same connection and transaction object, otherwise you'll spend a good half hour to hour banging your head against the wall and blaming the SQL Architect that his Stored Procedure is causing the problems...only to find out, you're missing a few extra parameters!  Arrh!

    Read more...

  • Reporting Services & Charting

    <rant>
    I'd like to proclaim that I HATE the charting capabilities in SQL Reporting Services.  I spent about an hour trying to figure out how to do a basic scatter graph with a very small set of data.  Well, after trying about 50 gazillion ways, I cannot get the graph to work.  Just to make sure I wasn't crazy, and actually knew the data I had could be graphed...I copied the  data into an Excel spreadsheet.  After that I inserted a chart, and 2 minutes later I had a scatter graph the way I wanted it.

    Why is it so freaking hard in Reporting Services? Why can't they have an easy to use tool like Excel?  Why did I spend so much time to get a chart that didn't work?  I just don't understand it.  I hate it! ARRH!
    </rant>

    Okay, now that I'm done ranting & raving, does anyone know how to properly chart things using SQL Reporting Services?

    Read more...

  • First Crack - Reporting Services

    Well I finally started to take the first crack at Reporting Services at work.  I'm going to be using it to generate some custom reports that they want, however I've only heard things about Reporting Services and how cool it is.  Well, after downloading, spending 1/2 a day setting up a server, and starting to play around with some basic reports..I'd definately have to say its a pretty cool product.  It is going to make reporting so much easier.  If you haven't checked this product out, I would definately say download the trial version, you'll be very happy.  Also, I'd like to mention that the development team did a SUPERB job on the IDE with integrating it into VS.NET.  Very slick and easy to use.  Now, how do I do those hard reports...

    Read more...

  • Custom NSIS Macros

    I was asked to provide my scripts that allow me to check for the .NET framework using NSIS.  I'll do one step better, I'll post my custom macros (downloadable of course) that will allow you to plug them right into your NSIS scripts and run required tasks.  Below is a brief introduction to each of the macros, this is so you'll know how to use them mainly:

    • eWorld_DetectNetFramework_10: This macro, as the name states, detects the .NET framework v1.0...but due to backwards compatability, it first checks for at least v1.1 of the .NET framework.  If either of the 2 frameworks are not found, the user is prompted and the installation quits.  This macro should be run in the .onInit function of your script, and only when you're installing assemblies compiled under the 1.0 framework.
    • eWorld_DetectNetFramework_11: Like its brother macro above, this will only detect for the v1.1 framework.  If the 1.1 framework is not found, the user is prompted, and the installation quits.  This macro should be run in the .onInit function of your script, and only when you're installing assemblies compiled under the 1.1 framework.
    • eWorld_DetectPreviousVersion: This will detect a previous version that is installed based on the registry key HKLM \ Software \ {APPLICATION NAME}.  It will also detect if a MSI is installed with a particular application name.  This macro takes 2 parameters, APPNAME and MSIAPPNAME.  If you pass in an empty string for MSIAPPNAME, it will not check for MSI applications.  If this macro detects a previous installation, it will prompt the user to uninstall it.  At this point, it will write a temporary file to note that it is currently uninstalling...then it will launch the uninstaller of the previous version.  This should be used in conjunction with eWorld_LaunchInstaller.  This macro should be run in the .onInit function of your script.
    • eWorld_LaunchInstaller: This will remove the temporary uninstall file created by eWorld_DetectPreviousVersion, and will launch the installer.  This macro should be called as the last step in your Uninstall function.

    There are a few other macros in this script file, however they're called from the macros listed above, and should not be used in any other manner.

    Download the Macros!

    Read more...

  • Finally found a .NET User group by me!

    My search has finally ended!  I've been looking to either find a Central Illinois .NET User Group, or start one up myself for about a year.  Well, today..by slight chance..the new DevDays portal pointed me to a Central Illinois User Group located no more than 20 miles away from me.  Luckily they're having their 3rd meeting tonight from 6-8:30 PM, so I'm gonna head on out to check it out...free giveaways tonight as well!  So, if you're in the Central Illinois area, and are looking to go, let me know, maybe we could coordinate a meetup tonight.

    Read more...

  • NNTP Plugin Page Setup

    I've setup a page containing information relating to the NNTP Posting Plugin for NewsGator.  This page will give you more detailed information, a change log, and other stuff (not yet defined).  By using this page you can keep up-to-date on the NNTP Plugin.

    As a side note, version 0.5 seems to be the tip of the iceburg for this plugin, so after a few weeks it may be moved into 1.0 status.  I've also setup a new forum where we can discuss the plugin, get support, and ask for enhancements.  Hopefully all this will lead to a community driven plugin.

    View the webpage | View the forum

    Read more...

  • Who Uses Windows 3.11?

    I've been studying my server logs for usage and just general information this morning, and I have to say that I'm just stunned of the amount of outdated software that is still in use.  As you can tell from the subject, I noticed, in the month of January, that there were 46 visits by people using Windows 3.11.  Why in the world would anyone still be using this, let alone a developer.  What's even more suprising, is that it beat out Linux by 20 visits.

    Another thing to note, is the use of outdated browsers.  While the top still stands at IE 6, IE 4 comes in a whopping second place, then Netscape 4, then IE 5.0, then 5.5x.  Why? I just don't understand it.  Although the real older browsers didn't make the top 5, it is interesting to note that Netscape 3 and 2 were in use during last month, maybe by those 46 users using Windows 3.11.  How do these people expect to get the best internet usage or experience using this software, it just baffles me.

    Have you run across anyone still using outdated (and unsupported) operating systems or browsers recently?

    Read more...

  • Updated Custom Control Set

    It was brought to my attention Saturday evening (through today) after I released my version 1.9 control set, that a few major "show stopper" bugs existed.  As such, I've patched them up and re-released v1.9 with the updated code.  Here's a list of those issues that were resolved:

    • Regular databinding to the Multi-Text List controls did not work.
    • Using AccordionExternalResourcePath failed to set properly for the AccordionPanel.
    • Javascript errors for CollapsablePanel when AllowTitleExpandCollapse was true.

    If you've downloaded my control set prior to 8:45 AM Central time this morning, I would suggest re-downloading the controls to receive the latest build.  Go to my download page.

    Read more...

  • In Need of Infamous Papers?

    It seems that Mike Rowe has decided to put 1 copy of the “WIPO book and 25-page letter” he received from Microsoft during their talks and settlement up for sale on eBay.  Mike had to start weeding out the real from fake bids, that exceeded over $200,000 earlier today.  He started by knocking of those who have 0 feedback, then went to pre-approval bidding only to serious bidders.

    So far, he has 3 days left, and no one has gotten a real bid through.  It'll be interesting to see if he actually sells this to someone.  Here's the CNet story.

    Read more...

  • Plugin Release: NewsGator NNTP Plugin v0.5

    Version 0.5 of the NewsGator NNTP Plugin to allow posting to newsgroups has been released.  This version includes proper cross-posting functionality to newsgroups, a major enhancement in server/newsgroup selection, enhancement in error descriptions now containing the server and newsgroup when sending an email to the developer, and lastly, the user will be restricted from posting empty posts to a server.  The first and last update were to start working towards GNKSA's seal of approval.

    Download Now!

    Read more...

  • WebFA Down, Permanently

    Tonight I had to make the hard decision to shut my free online family album service down.  I decided that since it has had very little usage over the last few months, that I'm wasting money on hosting fees.  For those who have never been to http://www.webfa.com, this site - dubbed WebFA - was my senior multi-media project I created in Oct-Dec. of 2002.  It was a GREAT learning tool, as .NET 1.0 was in its infancy stages, and a GREAT way to show off my skills to my professor.  The site was fun, to both use and build...however pulling the plug was the right thing. 

    If you would like a copy of the source code...well, too bad.  After several server, and workstation rebuilds, I lost all code to the site...thus making any updates impossible.  I do, however, have the SQL code (well its still on the database) as well as HTML markup...but without the good 'ol VB.NET code behinds, the sites useless.  If you would like a working copy, I can give you what I have...however, I suggest going to something like nGallery, as it has code.

    So long, fair well...(song fading as you see the website fading into the horizon).

    Read more...