Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘NET’

“Differences Between Visual Basic .NET and Visual C# .NET” white paper is available

Symptoms
This article points to the “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper.
Resolution
Because of the previous differences between Visual Basic and C/C++, many developers assume incorrectly about the capabilities of Visual Basic .NET. Many Visual Basic developers think that Visual C# is a more powerful language than Visual Basic. In other words, Visual Basic developers assume that you can do many things in Visual C# that you cannot do in Visual Basic .NET, just as there are many things that you can do in C/C++ but cannot do in Microsoft Visual Basic 6.0 or earlier. This assumption is incorrect.
Although there are differences between Visual Basic .NET and Visual C# .NET, both are first-class programming languages that are based on the Microsoft .NET Framework, and they are equally powerful. Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as inheritance, polymorphism, interfaces, and overloading. Both Visual Basic .NET and Visual C# .NET use the common language runtime. There are almost no performance issues between Visual Basic .NET and Visual C# .NET. Visual C# .NET may have a few more “power” features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding. However, the differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.
The “Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper describes some of the differences between Visual Basic .NET and Visual C# .NET. However, remember that the .NET Framework is intended to be language independent. When you must select between Visual Basic .NET and Visual C# .NET, decide primarily based on what you already know and what you are comfortable with. It is easier for Visual Basic 6.0 developers to use Visual Basic .NET and for C++/Java programmers to use Visual C# .NET. The existing experience of a programmer far outweighs the small differences between the two languages.
No matter which language you select based on your personal preference and past experience, both languages are powerful developer tools and first-class programming languages that share the common language runtime in the .NET Framework.
The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download the “Differences between Microsoft Visual Basic .NET and Microsoft Visual C# .NET” white paper package now.(http://download.microsoft.com/download/6/3/5/6354bf47-c597-4029-89e9-2495e7539ab9/vbcsharpwp.exe)Release Date: June 18, 2002
For more information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591?(http://support.microsoft.com/kb/119591/)How to obtain Microsoft support files from online servicesMicrosoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

PRB: IntelliSense Features Do Not Appear in Visual Basic 6.0 for .NET COM Interop Components

Symptoms
When you register a Microsoft Visual Basic .NET Component for COM Interop in the registry by using the Register for COM Interop option in Visual Studio .NET, the IntelliSense features for the methods and properties of the classes do not appear in your Visual Basic 6.0 application. Also, you cannot use early binding to bind to a method or a property.
Resolution
This problem occurs in the following scenario:When you use the Register for COM Interop option, the Visual Studio .NET build process calls the Regasm tool with the /TLB and /CODEBASE options to register the .NET Component for COM Interop.When you call to the Regasm tool, Visual Studio .NET creates a type library and a COM Callable Wrapper (CCW) Interop assembly.The type library is registered and acts as a COM object to gain access to the .NET assembly.By default, the Regasm tool creates a type library that exposes a non-dual, empty IDispatch interface. Therefore, you cannot use early binding. If you do not use early binding, the IntelliSense features do not appear.

PRB: IntelliSense Features Do Not Appear in Visual Basic 6.0 for .NET COM Interop Components

Symptoms
When you register a Microsoft Visual Basic .NET Component for COM Interop in the registry by using the Register for COM Interop option in Visual Studio .NET, the IntelliSense features for the methods and properties of the classes do not appear in your Visual Basic 6.0 application. Also, you cannot use early binding to bind to a method or a property.
Resolution
This problem occurs in the following scenario:When you use the Register for COM Interop option, the Visual Studio .NET build process calls the Regasm tool with the /TLB and /CODEBASE options to register the .NET Component for COM Interop.When you call to the Regasm tool, Visual Studio .NET creates a type library and a COM Callable Wrapper (CCW) Interop assembly.The type library is registered and acts as a COM object to gain access to the .NET assembly.By default, the Regasm tool creates a type library that exposes a non-dual, empty IDispatch interface. Therefore, you cannot use early binding. If you do not use early binding, the IntelliSense features do not appear.

BUG: You may receive a “Visual Basic internal compiler error” error message when you use the ADDHANDLER statement or the REMOVEHANDLER statement in Visual Studio .NET

Symptoms
You can pass an array as a base reference to the event in the ADDHANDLER statement or in the REMOVEHANDLER statement in your application. However, when you try to compile your application, the compiler stops responding instead of displaying compilation errors. When you close the Microsoft Visual Studio .NET IDE, you may receive the following error message:

Visual Basic .NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler error)
Save your work and restart Visual Studio .NET.
Resolution
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

BUG: When You Remove Visual C# .NET an Error May Occur If You Try to Install Visual Studio Tools for Office

Symptoms
When you try to install Microsoft Visual Studio Tools for the Microsoft Office System on a computer with Microsoft Visual Basic .NET Standard 2003 installed, you may receive the following error message:

Setup cannot detect the required version of Visual Studio .NET on this computer.Before you install this product, you must install a matching regional version of Visual Studio .NET 2003 or Visual Basic .NET 2003 Standard.
Resolution
This error may occur if all the following conditions are sequentially true:Visual Basic .NET Standard 2003 is installed on the computer.Microsoft Visual C# .NET Standard 2003 is installed onthe computer.Visual C# .NET Standard 2003 isremoved.You try to installVisual Studio Tools for Office.

BUG: One or more columns in the Results pane appear to be empty when you retrieve data in Visual Studio .NET or Visual Studio 2005

Symptoms
In Microsoft Visual Studio .NET or Visual Studio 2005, one or more columns in the Results pane appear to be empty when you retrieve data from a Microsoft SQL Server 2000 database table. This problem occurs when the following conditions are true:The database table contains a column of type CHAR, NCHAR, VARCHAR, or NVARCHAR.The column contains data that has more than 900 characters.
Resolution
The cells of the Results pane in Visual Studio .NET or Visual Studio 2005 cannot display data that has more than 900 characters.