February 2004 - Posts

Debugging the Debugger?
26 February 04 09:19 PM | mhawley | with no comments

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?

Filed under:
Another VS.NET Irk
20 February 04 03:42 PM | mhawley | 1 comment(s)

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.

Filed under:
NNTP Plugin... Plug
20 February 04 09:27 AM | mhawley | 2 comment(s)

Thanks for the great plug and announcement Greg!

Greg also mentions Graeme Foster's new plugin FetchLinks.  I'm just hoping this works for my SlickDeals.net feeds :)

Good Uses for Empty Array Declarations
20 February 04 08:54 AM | mhawley | 2 comment(s)

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?

Filed under:
Interesting Tidbit
19 February 04 02:14 PM | mhawley | 1 comment(s)

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.

Filed under:
I love Master Pages
19 February 04 09:37 AM | mhawley | 2 comment(s)

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!

Filed under:
DataGrid's GridLines Property
16 February 04 09:39 AM | mhawley | 1 comment(s)

<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>

ADO.NET Irks Me
12 February 04 02:08 PM | mhawley | 13 comment(s)

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!

Filed under:
Reporting Services & Charting
11 February 04 01:56 PM | mhawley | 1 comment(s)

<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?

Filed under:
First Crack - Reporting Services
06 February 04 02:17 PM | mhawley | 2 comment(s)
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...
Filed under:
More Posts Next page »

This Blog

News

.NET Links

Blogs I Read

Syndication