The main aim of this blog is to give a better coding experience to those programmers who are good in VB6 but know nothing about VB.Net 2005. This blog will provide hard coding experience in VB.Net 2005 and Dot Net Framework 2.0.
To comfortably use the ADO.NET objects in an application, you should use the IMPORTS statement. By doing so, you can declare ADO.NET variables without having to fully qualify them. You could type the following IMPORTS statement at the top of your solution:
A Namespace is a collection of different classes which are built in to .Net. You need to import theses namespaces to work with any .Net language. All the functionality of .Net is within these namespaces.
So, before proceeding with the coding we have to use this statement:
Imports System.Data.SqlClient
Four core objects belong to .NET data providers, within the ADO.NET managed provider architecture is: the Connection, Command, DataReader and DataAdapter objects.
The Connection object is the simplest one, because it establishes a connection to the database.
The Command object exposes a Parameters collection, which contains information about the parameters of the command to be executed.
The DataReader object provides fast access to read-only, forward-only data, which is identical to read-only, forward-only ADO Recordset in VB6.0.
The DataAdapter object contains Command objects that enable you to map specific actions to your data source. The DataAdapter is a mechanism for bridging the managed providers with the disconnected DataSets.
The DataSet object is not part of the ADO.NET managed provider architecture. The DataSet exposes a collection of DataTables, which in turn contain both DataColumn and DataRow collections. The DataTables collection can be used in conjunction with the DataRelation collection to create relational data structures.

No comments:
Post a Comment