I wanted to find out what is inside of a particular DLLHost.exe.   I went into Component Services and used "View|Status" do see the PIDs of each COM+ Application which I can then correlate to a PID in Task Manager.  Shouldn't there be a COM+ Explorer/Spy/Info Application for this, or did I miss it?



Say you've a black-box application that you can't change that is culture-ignorant and returns a date as a string that looks like this:

6/11/2003 1:56:31 PM

but your client wants it output like this

11-Jun-03 01:56:31 PM

Sometimes folks ask me "What's the best way to parse a Date string in .NET?"  Often they are old school VBA-type folk and they are really saying "I'm going to use InStr() to parse this date unless you stop me."

So, here's a better way, IMHO.  I believe in avoiding Mid$, InStr, strstr, etc...it's just not my business to parse strings.  This is, of course, not the only way, but a possible way.  (Certainly the CultureInfo should be cached, things could be better localized, etc):

System.IFormatProvider format = new System.Globalization.CultureInfo("en-US", true);
DateTime lastLogin = DateTime.Parse(Session["lastSignOn"].ToString(),format);
lblLastLogin.Text = String.Format("Your last login was: {0}", lastLogin.ToString("dd-MMM-yy hh:mm:ss tt"));

Note that we know we are getting a the string as a U.S. formatted date time, we pass in our CultureInfo object that implements IFormatProvider to DateTime.Parse, then pass it our custom Format String to the new DateTime object's ToString(). 

This is the kind of higher level layer of abstraction that allows me to focus on business and avoid work.  Parsing DateTimes is administrivia...it's lame-o work.  The Marketects at Microsoft say "Do more with less" but I prefer my own saying "Do more business, do less work."

Put it down sir...step away from the manual string parsing code...no need for strstr() here...



Bitter XML Quote of the Day

Posted 2003-06-11 07:07 AM in Web Services | XML.

"Without an XML Schema, you might as well replace all those < and > signs with quotes and commas, 'cuz that's what you've got - just less-than/greater-than-delimited text."

I'll be presenting this rant and many other as a PADNUG Web Services SIG meeting sometime this year in a presentation loosely titled: "Mailing a Boot: Exactly how NOT to use XML and Web Services"

Certainly schema isn't required, but when you spend the date passing DateTimes and decimals around in XML, you get used to clients of your XML using the associated schema for simple data typing. 



My Graduation Cake

Posted 2003-06-10 06:27 AM in Web Services.

A picture named UPDATED P0006191 (Medium).jpgMy wife used the C# Wallpaper from IrritatedVowel.com on the top of my Graduation cake...the results are pretty snazzy!  Everyone was quite impressed with code on a cake, although lots of not-so-funny-people insisted there were some syntax errors...:)



Here's a useful and exciting thing to discover on my return from TechEd:  EasyStreeet is offering Free .NET Hosting for Developers.   It's Six Months Free with the .NET Framework 1.1, with ASP.NET, all the BCL (of course), and support for Web Services.

I've been looking around at inexpensive but powerful ASP.NET Hosting to get some of my other small projects off the ground (in addition to www.diabeticbooks.com and www.pioneercourthousesquare.com among others) and this looks like a deal that's too sweet to pass up...might be a nice way to start testing out some blogging and RSS aggregation thoughts, as well as some No-Touch-Deploy WinForms.

All you have to do is email them to get setup:

To submit your request: email your name, company name, email and phone number to NETPlayground@easystreet.com.




Contact

Sponsors

Hosting By

Hot Topics

Tags

Calendar

<June 2003>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

February, 2010 (8)
January, 2010 (13)
December, 2009 (13)
November, 2009 (7)
October, 2009 (19)
September, 2009 (11)
August, 2009 (12)
July, 2009 (21)
June, 2009 (26)
May, 2009 (16)
April, 2009 (13)
March, 2009 (17)
February, 2009 (17)
January, 2009 (18)
December, 2008 (32)
November, 2008 (17)
October, 2008 (22)
September, 2008 (16)
August, 2008 (14)
July, 2008 (25)
June, 2008 (19)
May, 2008 (17)
April, 2008 (17)
March, 2008 (26)
February, 2008 (21)
January, 2008 (28)
December, 2007 (19)
November, 2007 (17)
October, 2007 (31)
September, 2007 (39)
August, 2007 (37)
July, 2007 (43)
June, 2007 (37)
May, 2007 (32)
April, 2007 (38)
March, 2007 (29)
February, 2007 (46)
January, 2007 (31)
December, 2006 (27)
November, 2006 (31)
October, 2006 (32)
September, 2006 (39)
August, 2006 (34)
July, 2006 (40)
June, 2006 (18)
May, 2006 (31)
April, 2006 (34)
March, 2006 (30)
February, 2006 (38)
January, 2006 (44)
December, 2005 (19)
November, 2005 (34)
October, 2005 (24)
September, 2005 (37)
August, 2005 (20)
July, 2005 (24)
June, 2005 (33)
May, 2005 (16)
April, 2005 (22)
March, 2005 (34)
February, 2005 (15)
January, 2005 (37)
December, 2004 (28)
November, 2004 (30)
October, 2004 (34)
September, 2004 (22)
August, 2004 (34)
July, 2004 (18)
June, 2004 (64)
May, 2004 (49)
April, 2004 (21)
March, 2004 (29)
February, 2004 (29)
January, 2004 (36)
December, 2003 (25)
November, 2003 (24)
October, 2003 (59)
September, 2003 (42)
August, 2003 (24)
July, 2003 (44)
June, 2003 (29)
May, 2003 (21)
April, 2003 (30)
March, 2003 (27)
February, 2003 (47)
January, 2003 (50)
December, 2002 (31)
November, 2002 (38)
October, 2002 (44)
September, 2002 (15)
May, 2002 (2)
April, 2002 (4)

Google Ads