Geeks With Blogs

News INETA Community Speakers Program WTFNext's hosting!

View Stacy Vicknair's profile on LinkedIn

WTF Next? Dev ramblings from a master of nothing. .NET Tips bite-size morsels of programming goodness
VS2010 SP1 - The file is under source control and is not checked out
If you’ve recently upgraded to SP1 and tried to build a solution checked out from TFS you might have come across the following dialog. Not only does it not allow you to cancel the build process, but it also REPEATEDLY THROWS THE DIALOG PREVENTING YOU FROM STOPPING THE PROCESS. Very annoying. There is a hotfix available via connect and code gallery that will stop this problem. Connect Bug Entry: ......

Posted On Wednesday, May 11, 2011 11:27 AM

.NET XPath Returns No Results
When using XPath in .NET one of the gotchas to be aware of is that all namespaces must be named, otherwise you’ll end up with no results. Default namespaces that are specified with xmlns alone still need to be recognized in the XPath query! Say I had a bit of XML like what is returned from the QueryService web service in Sharepoint: 1: <?xml version="1.0" encoding="UTF-8"?> 2: <ResponsePacket xmlns="urn:Microsoft.Search... 3: <Response> 4: <Range> 5: ... 6: <Results> ......

Posted On Thursday, March 10, 2011 2:57 PM

How necessary is CLS compliance?
The answer, as with so many other questions in the coding world, is that it depends. However, for the average developer CLS compliance is not a concern. For the specialized component or tool developer CLS compliance might be your bread and butter winner. For the average developer, CLS compliance is nothing more than bragging rights or an enforced rule at your organization. You probably only operate in one language provided graciously from MSFT and have little concern if your libraries will play nicely ......

Posted On Wednesday, August 19, 2009 11:46 AM

.NET Tip: Using String Constructors
When we use string so often for its value-like behavior, it is easy to forget that the String class comes with its own constructors, and that there are some tasks you can achieve with the string constructor that you might have overlooked otherwise. Repeating characters One of the more useful overrides of the String constructor is the ability to easily repeat any character a number of times. Here’s a brief example: Dim horizontalRule As New String("-"c, 100) Console.WriteLine(horizonta... Subsections ......

Posted On Monday, May 4, 2009 9:31 AM

.NET Tip: Regular expression "/d" is more than just 0-9
In Java, this is not the case as far as I know. However, when working with regular expressions in .NET, be weary of just slapping /d in when you need a number alone. Just like Char.IsDigit isn't just numbers, /d follows suit. The reason is that /d and Char.IsDigit are both validating against the Unicode designation "Nd". This stands for number decimal digit, but does not limit itself to just 0-9. If you're using regular expressions to begin with, you probably already realize that it is fairly easy ......

Posted On Tuesday, December 30, 2008 8:38 PM

.NET Tip: Char.IsDigit revisited
In a previous .NET Tip, I compared IsDigit to IsNumber for parsing numbers from a string. I wanted to point out that it is true that Char.IsDigit does only get decimal digits, but to further elaborate that this isn't just 0 through 9. Sure, 0 through 9 are the decimal digits that most of us would consider the only ones. However, with the globalization being a major push for .NET, we've got to think outside of our local scope. Char.IsDigit will also pick up other culture specific decimal digits. What ......

Posted On Tuesday, December 30, 2008 2:32 PM

.NET Tip: Match.Groups starts at 1 not 0
I'm currently studying for my first Microsoft certification exam, the 070-536, and during the process I came across this small quirk. Although most object arrays or collections in VB.NET start at 0, the Match.Groups collection starts at 1. This could potentially be a small frustration for those who don't use regex that often (especially with the added need to extract the information instead of just validating it). So, if you are extracting information using regex in the future, keep in mind your ......

Posted On Monday, December 15, 2008 1:37 PM

.NET Tip: When to use Char.IsDigit versus Char.IsNumber
Char.IsDigit and Char.IsNumber are both methods within the System namespace. The methods themselves are almost confusing in name at first glance. You might think that they do the same thing, but then why have both? Well, because they don't do the same thing. IsDigit refers to only the decimal digits whereas IsNumber can refer to anything in the numeric Unicode category. So, if you just want decimal, stick with IsDigit. Otherwise, you'll be getting a lot more than you bargained for if cleaning data ......

Posted On Tuesday, December 9, 2008 3:15 PM

.NET Tip: Getting information from DataTable.DefaultView using RowFilter
So it may make sense to you how to fetch information from a DefaultView using RowFilter by binding the view, but what about when you just need to extract a value? After applying a RowFilter, the first inclination might be to use the DefaultView.Table.Rows to get information that is filtered. Well, that is ultimately wrong. The DefaultView.Table returns the table the view had originated from. The table you get does not have the RowFilter restrictions applied, and therefore returns the whole table. ......

Posted On Tuesday, December 2, 2008 12:38 PM

.NET Tip: authorization forms credentials default is SHA1, not Clear
I was recently following along in a quick tutorial in Microsoft ASP.NET Programming with Microsoft Visual Basic .NET Version 2003 Step By Step by G. Andrew Duthie, when low and behold I came across a fundamental tutorial about ASP.NET authentication that just didn't work. The culprit? authorization forms credentials has a default of SHA1, not Clear that the book assumed. I checked through the MSDN entries to make sure this still applied in 3.5, even though the book was written for ASP.NET 1.1 (which ......

Posted On Friday, November 21, 2008 3:25 PM

Copyright © Stacy Vicknair | Powered by: