Microsoft KB Archive/316511

= BUG: You receive an unrecoverable compiler error if you reference the ListManager property =

Article ID: 316511

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Visual Basic 2005 Express Edition
 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition

-



This article was previously published under Q316511



SYMPTOMS
If the instance of the CurrencyManager is accessed and assigned to a variable directly through the ListManager property of the DataGrid control in Microsoft Visual Basic .NET, you receive the following error message:

Visual Basic .NET compiler is unable to recover from the following error: Internal compiler error: code generator received malformed input. Save your work and restart Visual Studio .NET.

After you receive this error message, commentate out from the code or modify the line that caused this error message, save your project, and then quit and restart Microsoft Visual Studio .NET.

Note In Microsoft Visual Studio 2005, you may receive the following error message:

error BC30390: 'System.Windows.Forms.DataGrid.Protected Property ListManager As System.Windows.Forms.CurrencyManager' is not accessible in this context because it is 'Protected'.



CAUSE
This problem occurs because the DataGrid control contains a member that generates a naming conflict with the ListManager property.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
The ListManager property of the DataGrid control is a protected member, and therefore cannot be accessed directly. The protected ListManager property exposes the CurrencyManager class for the DataGrid control. As it is a protected member of the DataGrid control, you cannot assign this property directly to a variable in your Visual Basic .NET project. If you try to assign this property, you receive the error message mentioned in the &quot;Symptoms&quot; section and you must restart Visual Studio .NET.

Steps to Reproduce the Problem
NOTE: The following code is only for demonstration and it should not be compiled at all.  Start Visual Studio .NET or Visual Studio 2005, and then create a new Windows Application project. On the Project menu, add a new module (Module1) to the project.  Add the following code to the module: Public Module Module1 Sub Main Dim DGrid As New DataGrid Dim CurManager As CurrencyManager = DGrid.ListManager End Sub End Module  Edit the line of code that defines the CurManager variable. For example, remove and then add back the equal sign (=) character.

Keywords: kbvs2005applies kbvs2005swept kbvs2002sp1sweep kbbug kberrmsg kbnofix KB316511

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.