Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]


<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src=""> </script>

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.


Cool .NET Articles

My .NET Tools

My Articles

My MSKB Articles

July 2003 - Posts

.NET Framework Graphics - "No Brainer Compatibility"

Paul Alexander was kind enough to put together a series of really slick graphics elements that were designed to denote which version of the .NET Framework a particular component was compiled to. This is ideal in situations where you either a) only have one compiled version of your app, or b) have separate installers for each version.

I spent the past few hours cleaning up Paul's Illustrator file. It's really slick now, because you can show and hide different layers to produce different graphics depending on your needs. In the file he gave me had the whole graphics as entirely separate elements.

I'm callling them "Framework Compatibility Graphics", and here's what they look like:

Interscape and Xheo together are proposing this to the community as a standard for denoting Framework compatibility. To accelerate this process, we have created a Zip file archive with Adobe Illustrator and Photoshop versions for these graphics. You can download it here. The archive contains 3 different sizes for each graphic (except the smallest size does not have the faded version, it was impractical). We highly encourage everyone to take advantage of this immediately. The better we, as developers, educate our customers, the better it will be for everyone.

UPDATE: The archive contains gif files at three different sizes, so you don't have to mess with the PSD or AI files if you don't want to. The sizes are shown here:


I'll be talking more about this over the next several days, and how to effectively brand your products with these logos. I'll also talk about how they fit into the overall versioning strategy that Interscape and XHEO is pushing.

Special thanks goes out to Paul at for taking the time to create these graphics. He did an outstanding job.

Special Thanks

I'd like to take a minute to give a special thanks to Roy Osherove for his assistance this morning in tracking down a particularly nasty bug in my XML format support for GenX.NET this morning. I'll go into specific details later about what happened, and what a still unexplained nuisance, but I can finally grab a quick nap, knowing that the code for GenX.NET is now officially 100% complete.

Thanks a bunch Roy. And thanks to everyone else that has helped me get my brain around this architecture for the past two months. It has been well worth it. You guys are the best.

Posted: Jul 27 2003, 06:24 AM by interscape | with 1 comment(s)
Filed under:
Newbies Pay Attention

Ok, this may be common knowledge for most of you, but for the rest listen up:

I spent the past 2 days playing with collections. My opinion: They suck. I can't wait for generics, because there is entrely way too much coding that you have to do to get a collection working. And would there be easy-to-follow samples ANYWHERE about them.... noooo. The closest I came was Darren Nimike's example on ShowUsYourCode. {Darren, a brief note: update to ASP.NET ;) }

So I wanted to be able to access an item in the collection by a value and not by an index. I started by inheriting from CollectionBase, then I tried overloading my Item property with one that accepts a string, and returns the following information:


I was of the impression that this would work. It didn't. I didn't really feel like digging around a whole lot more for it, because I'm trying to get GenX.NET wrapped up already, and I just wanted to hold key/value pairs anyways. So I killed all my code, and replaced it with one line underneath my collection definition:

Inherits NameValueCollection

I couldn't be happier. It does exactly what I need it to... no fuss, no mess. The whole collections issue is definitely going to warrant an article. It's just too damned difficult the way it is.

Great Idea for an MS Product

My friend Brian had a great idea for an MS Product today. I've dubbed it "CleanSlate". CleanSlate would basically be a hard-drive image on DVD of a system preinstalled with the following, configured to MS best practices:

Windows (XP, 2003, or Longhorn)
Microsoft Office System 2003 Professional
SQL Server 2000 SP3 Developer Edition
VS.NET 2003 (Pro, ED, or EA)

Ideally, this would cost under $700 low-end, and under $2000 for the works, and it would be installable on up to 3 separate machines, unlimited number of installs per machine.

I'd buy it without hesitation.

Now, if I only had an MS License Agreement and a DVD Burner......

Rebutting Scoble on Corporate Secrets

I took some time tonight to reply to Scoble's long awated in-depth conversation about Corporate Secrets. I bugged him to write about this some time back, and I'm glad he got around to it. His blog has been awfully bland lately anyways. If I had a quarter for every time he said "You'll just have to wait until PDC", I might actually be able to afford to go ;).

Why I Use Visual Studio.NET

I was at, and I saw this ad:


Maybe I'll stick with VS.NET. At least it kicks out VALID tags.

Your TabletPC Thoughts?

OK. I'm gonna do it. I'm gonna buy a TabletPC. Confronted with the hideous thought of spending the next 6 hours reading documentation on all the Alpha and Beta software I got from MS this week, I cannot think of any other way.

I'm sure may of you out there are using one already. So which ones are you using, and what do you think about them? How are they working out for you? What do you hate about it? Have you found one that is powerful enough to develop on?

Please leave me some comments in my blog regarding these questions. I'd like to be as informed as I can so I can make the best decision possible.

Cool StringBuilder Tip

One of the great things about the StringBuilder is it's ability to dynamically resize itself for situations where it is dealing with large strings. It was very helpful in building GenX.NET, especially since I wasn't always going to be writing to the file system anymore. Back in the 2.0 days, each time I loaded up a new line, I wrote it to the file system, so performace wasn't really a factor. Now it is. The problem is, however, that this dynamic resizing can sometimes come at a performance hit IF you are adding to your string beyond 1000x.

Enter StringBuilder.EnsureCapacity(Integer)

For GenX.NET, it is quite conceivable that the StringBuilder may append new data over a million times. Well, I want to make sure that it resizes itself as few times as possible. So, before I output any data, I cycle thru the Tables, Rows, and Columns collections of the DataSet, and get a total cell count. Then, I multiply that number by 30, and I have a fairly rough approximation of how much data the StringBuilder will be holding when finished. This saves me from most of the resizing that will take place on large DataSets.

What did it do for performance? Well, small files are returned almost instantaneously. Larger files are generated in almost half the time it took before I added that simple algorithm. I'm sure it will definitely have an effect when the server is under a heavier load too.

So there you have it. StringBuilders run faster if you call .EnsureCapacity first.

Posted: Jul 25 2003, 04:20 PM by interscape | with 3 comment(s)
Filed under:
Microsoft Sitting Pretty

Courtesy of eWeek:

Meanwhile, the .Net programming environment made gains over the Java platform. Last year, 30 percent of enterprise developers used Java and 25 percent used the .Net Framework and Microsoft's Visual Studio .Net. Now, Rudder said, 37 percent of developers use .Net compared to 33 percent using Java, according to industry sources compiled by Microsoft. In addition, of the developers using scripting languages, 51 percent use Microsoft's Active Server Pages (ASP) and ASP.Net, Rudder said.

Now, if only Eric would BLOG MORE OFTEN.

In the same article:

On the Windows front, Windows Server 2003 is selling at a triple run rate that that of Windows 2000 in the same time frame.

Did any of you guys know that the DropDownList control has a new property in VS.NET 2003? It's called SelectedValue, and it gets the value of the selected item, or sets the value to an item based on a string.


This was my biggest pet peeve with 1.0... there was no simple way to accomplish this, and nonexistent documentation from MS about it. I'm still in shock. Thanks MS!

More Posts « Previous page - Next page »