Author Archives: Mel

Configuration Manager not visible in Visual Studio

advanced build configuration

I needed to debug a windows service using Visual Studio, and was able to use the Attach to Process… feature in the IDE. Even though Visual Studio was attached to the executable, it still didn’t stop at any breakpoints. I thought I could fix this by using Build->Configuration Manager to change the Configuration from Release to Debugmode, but the Configuration Manager option wasn’t available. After searching the internet, I found a forum, with a solution that worked for me.

I solved the problem by using the following menu options:
Tools -> Options -> Projects and Solutions -> General

Show advanced build configurations” was unchecked, once I checked this option the Build->Configuration Manager was available again.

JavaScript vs. JScript vs. ECMAScript

JavaScript is a prototype-based scripting language that is dynamic, weakly typed and was formalized in the ECMAScript language standard.

JScript is the Microsoft implementation of the ECMA 262 language specification (Source).

ECMAScript is the scripting language standardized by Ecma International and is widely used for client-side scripting on the web.

Here’s a good explanation.

Collection Types Commonly Used in .NET

This is a question that was asked during an interview and I didn’t know the correct answer, so I thought I would add the information I found to “My Online Notepad“. Maybe it can also help someone else.

  • Hash Tables – A collection of key/value pairs that are organized based on the hash code of the key. The Dictionary(Of TKey, TValue) and ConcurrentDictionary(Of TKey, TValue) classes have similar functionality as the Hashtable. The elements of Hashtable are of type Object, so boxing and unboxing typically occur when you store or retrieve a value type.
  • Queues – A first-in, first-out collection of objects. This is useful if you want to access the information in the same order that it is stored in the collection. There are three primary operation that can be performed on Queues and its element: Enqueue, Dequeue, Peek
  • Stacks – A simple last-in-first-out (LIFO) non-generic collection of objects. There are three primary operation that can be performed on Stacks and its element: Push, Pop, Peek
  • Dictionaries – A collection of keys and values. Typically provides better performance than a Hashtable for value types.
  • Lists – A strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.

XML documentation parse error (warning in Visual Studio)

I was working with a VB.NET project today and noticed the following warning:

XML documentation parse error: Whitespace is not allowed at this location. XML comment will be ignored.

After a quick search on the web I found the problem was using the ‘&’ character which is a reserved character for XML documentation. So my solution was to change ‘&’ to ‘and’ but I also found that placing the comment inside of <![CDATA[ Comments ]]> works. Here’s an example of my comment:

''' 
''' This is a comment with an ampersand & causes a warning in Visual Studio.
''' 
''' 
''' 
''' 
Public Property s1() As String
	Get
		Return ""
	End Get
End Property

TOP 100 PERCENT and ORDER BY

In SQL Server 2008, the TOP 100 PERCENT and ORDER BY is ignored. In SQL Server 2005, the output order isn’t guaranteed.

For example if you created a view like so:

CREATE VIEW vwProduct
AS
SELECT TOP 100 PERCENT lProductID, vsProduct FROM dbo.tblProduct AS tl
ORDER BY lProductID DESC
GO

And tried to select from it expecting the results to be ordered as specified in the view, it’s not going to happen.

-- Select From View
SELECT lProductID, vsProduct
FROM vwProduct

This would return the results ordered ascending not descending:
lProductId  vsProduct
———– ———
1           Widget A
2           Widget B
3           Widget C
4           Widget D
5           Widget E

Boolean object in JavaScript

The Boolean object represents two values either “true” or “false”.

new Boolean(value);

If value parameter is omitted, 0, -0, null, false, NaN, undefined, or the empty string (“”), the object has an initial value of false due to automatic type coercion.

Here’s a simple test for the JavaScript boolean object, here’s the HTML anchor tag I used to call a function:

<a href=”http://www.melvinswebstuff.com” onclick=”GetBoolean(‘true’); return false;”>Get Boolean</a>

Here’s the JavaScript function:

function GetBoolean(bBool){
	//Create a boolean object
	var myBoolean = new Boolean();
	myBoolean = true;
	
	if(myBoolean) alert('myBoolean = ' + myBoolean);
	
	if(myBoolean) alert('bBool = ' + bBool);
	
	if(bBool == myBoolean){
		alert('bBool == myBoolean');
	} else {
		alert('bBool <> myBoolean');
	}
	
}

FreeTextBox – FontFacesMenuList , FontFacesMenuNames, FontSizesMenuList, FontSizesMenuNames

I was able to change the font-family and font size drop down lists, see example below using VB.NET.

<FTB:FreeTextBox runat="server" ID="ftb" />
Dim fontFaces() As String = {"Time New Roman", "Georgia", "Arial", "Tahoma", "Wingdings"}
Dim fontFaceNames() As String = {"Time", "Georgia", "Arial", "Tahoma", "Wingdings"}
ftb.FontFacesMenuList = fontFaces
ftb.FontFacesMenuNames = fontFaceNames

Note: The list of font sizes available are 1-7, the default is 3.

Dim fontSizes() As String = {"1", "2", "3", "4", "5", "6", "7"} 
Dim fontSizeNames() As String = {"8", "10", "12", "14", "16", "18", "20"}
ftb.FontSizesMenuList = fontSizes
ftb.FontSizesMenuNames = fontSizeNames

5