I have found a number of errors in sample code (which of course are one of the easiest to prove, just compile and run). For example the example code for a console app for ConfigurationManager had two bugs I discovered: 1) In Sub DisplayAppSettings() the for at the end: For i = 0 To appSettings.Count Console.WriteLine("#{0} Name: {1} Value: {2}", i, _ keys(i), appSettings(i)) Next i Results in an exception, that is Index was outside the bounds of the array. The line should read: For i = 0 To appSettings.Count - 1 2) In Sub DisplayConnectionStrings() the while loop is missing incrementing i as in the commented line I added below: Dim conEnum As IEnumerator = connections.GetEnumerator() Dim i As Integer = 0 While conEnum.MoveNext() Dim name As String = connections(i).Name ''i += 1 Dim connectionString As String = _ connections(name).ConnectionString Dim provider As String = _ connections(name).ProviderName Console.WriteLine("Name: {0}", name) Console.WriteLine("Connection string: {0}", connectionString) Console.WriteLine("Provider: {0}", provider) End While Obviously these were not test (or not tested correctly). I admit they where easy to fix but still was a (minor) pain in the neck. It is interesting to note that similar code found during a search on connectionStrings is correct, i.e. with the index variable incremented. Thanks, John Leather
J
jleather
@jleather
Posts
-
MSDN Documentation... -
Amazon suedJeremy Falcon wrote:
Well, to hell with this. I'm broke, so I'm gonna patent u-turns on vehicles. If you people wanna do that in the future you better pony up the cash before I call 1-800-LAWSUIT.
:~ Sorry I already have that patent (although collecting on it has been a problem!??!. I wonder, can I sue you for stealing my idea in a pre-patent patent lawsuit?? I would be afraid to ask, the answer might be yes (or maybe, or if I have more re$ource$)!! John Leather
-
Book RecommendationsI second the Rama series, but I believe there are more than three titles. While your at it, Robert L. Forward is a great read for hard science SF. I suggest Dragons's Egg and the sequel, Star Quake.