FIX: Data is not loaded in the DataGrid control if you use the RetrieveFields option in Visual Basic 6.0 (316159)



The information in this article applies to:

  • Microsoft ADO.NET (included with the .NET Framework)
  • Microsoft Visual Basic .NET (2002)

This article was previously published under Q316159

SYMPTOMS

If you upgrade a Microsoft Visual Basic 6.0 project to Microsoft Visual Basic .NET, and the project contains a DataGrid control that was populated by using the RetrieveFields option, the data does not appear in the grid.

RESOLUTION

Use one of the following methods to resolve this problem:
  • Delete and re-add the DataGrid control after you upgrade the Visual Basic 6.0 project to Visual Basic .NET.

    -or-
  • Right-click the DataGrid, click ActiveX, and then click Retrieve Fields in Visual Basic .NET.

STATUS

This bug was corrected in ADO.NET and Visual Basic .NET (2003).

MORE INFORMATION

Steps to Reproduce the Problem

  1. Create a new Standard EXE project in Visual Basic 6.0.
  2. On the Project menu, click Components, and then select Microsoft ADO Data Control 6.0 and Microsoft DataGrid Control 6.0 to add these items to the toolbox.
  3. In the connection string property of the ADO Data control, click Build to build a connection string that points to the Biblio.mdb database that ships with Visual Basic 6.0.
  4. Set the RecordSource property for the ADO Data control to the Authors table.
  5. Set the DataSource property of the DataGrid control to ADODC1.
  6. Right-click DataGrid1, and then click Retrieve Fields.
  7. Save your project.
  8. Open the project in Microsoft Visual Studio .NET.
  9. After the conversion completes, run the project.

    Notice that the grid is empty.

Modification Type:MinorLast Reviewed:2/3/2006
Keywords:kbvs2005doesnotapply kbvs2005swept kbfix kbmigrate kbDataBinding kbpending kbWindowsForms KB316159