Export (0) Print
Expand All

Data Changes in Visual Basic .NET

In Visual Basic 6.0, data access was accomplished using ActiveX Data Objects (ADO). In Visual Basic .NET, data access is accomplished using ADO.NET, which is a part of the .NET Framework. There are a number of differences both conceptually and in terms of tasks between the two technologies. For more information on conceptual differences between ADO and ADO.NET, see Comparison of ADO.NET and ADO.

Note   Visual Basic 6.0 also provided backward compatibility support for Remote Data Objects (RDO) and Data Access Objects (DAO). These technologies are supported in Visual Basic .NET only as COM objects; applications that use RDO or DAO data binding cannot be upgraded to Visual Basic .NET. For more information, see Upgrading Applications Created in Previous Versions of Visual Basic.

In Visual Basic 6.0, there were two common methods of implementing data access in an application: at design time by binding to an ADODC control or by using a Data Environment, or at run time by creating and interacting with recordset objects programmatically. In Visual Basic .NET, there are two analogous methods of implementing data access: at design time by using data adapters and datasets, or at run time by adding code to create data adapters and datasets programmatically. For more information, see Creating Data Adapters and ADO.NET Datasets.

In Visual Basic 6.0, data binding was accomplished by setting the binding-related properties of a control: DataChanged, DataField, DataFormat, DataMember, and DataSource. In most cases, the display property of a control (for example, the Text property of a TextBox control) was bound to a field in a data source.

In Visual Basic .NET, data binding has a much broader definition — you can bind any property of any control to any structure that contains data. Binding in Windows Forms is accomplished via a DataBindings property that contains a collection of Binding objects for the control. For more information, see Data Binding and Windows Forms.

Note   ADO data binding is supported for backward compatibility via the Microsoft Visual Basic .NET Compatibility Data Runtime.

In Visual Basic 6.0, data-bound forms were automatically created by dragging database elements from a Data Environment onto a form.

In Visual Basic .NET, you automatically create data-bound forms by running the Data Form Wizard. For more information, see Data Form Wizard.

In addition to support for ADO.NET, Visual Basic .NET also provides support for direct programmatic access to databases using data commands. For more information, see Performing Database Operations Directly.

See Also

Introduction to Data Access with ADO.NET | Data Access Technologies | Introduction to Visual Basic .NET for Visual Basic Veterans | Data Namespaces in Visual Studio

Show:
© 2014 Microsoft