Questions
Questions
Answer 1: ADO stands for Active Data Object and ADO.NET is a set of .NET libraries for ADO.
ADO.NET is a collection of managed libraries used by .NET applications for data source
communication using a driver or provider:
• Enterprise applications handle a large amount of data. This data is primarily stored in
relational databases, such as Oracle, SQL Server, and Access and so on. These databases
use Structured Query Language (SQL) for retrieval of data.
• To access enterprise data from a .NET application, an interface was needed. This
interface acts as a bridge between an RDBMS system and a .NET application. ADO.NET is
such an interface that is created to connect .NET applications to RDBMS systems.
• In the .NET framework, Microsoft introduced a new version of Active X Data Objects
(ADO) called ADO.NET. Any .NET application, either Windows based or web based, can
interact with the database using a rich set of classes of the ADO.NET library. Data can be
accessed from any database using connected or disconnected architecture.
ADO.NET provides mainly the following two types of architectures:
• Connected Architecture.
• Disconnected Architecture.
ADO.NET Namespaces
Namespaces Description
System.Data Contains the definition for columns,
relations, tables, database, rows, views and
constraints.
System.Data.SqlClient Contains the classes that are used to connect
to a Microsoft SQL Server database such as
SqlCommand, SqlConnection,
SqlDataAdapter.
System.Data.Odbc Contains classes required to connect to most
ODBC drivers. These classes include
OdbcCommand,OdbcConnection.
System.Data.OracleClient Contains classes such as
OracleConnection,OracleCommand required
to connect to an Oracle database.
The disconnected components build the basic ADO.NET architecture. You can use these
components (or classes) with or without data providers. For example, you can use a DataTable
object with or without providers and shared or common components are the base classes for
data providers. Shared or common components are the base classes for data providers and
shared by all data providers. The data provider components are specifically designed to work
with different kinds of data sources. For example, ODBC data providers work with ODBC data
sources and OleDb data providers work with OLE-DB data sources.
Figure represents the ADO.NET components model and how they work together:
Answer 3: A DataSet object falls in disconnected components series. The DataSet consists of a
collection of tables, rows, columns and relationships.
Answer 4: Connection pooling is the ability of reusing your connection to the database. This
means if you enable Connection pooling in the connection object, actually you enable the re-
use of the connection to more than one user.
ADO.NET uses a technique called connection pooling, which minimizes the cost of repeatedly
opening and closing connections. Connection pooling reuses existing active connections with
the same connection string instead of creating new connections when a request is made to the
database. It involves the use of a connection manager that is responsible for maintaining a list,
or pool, of available connections for a given connection string. Several pools exist if different
connection strings ask for connection pooling.
Example of Pooling:
1. connection.ConnectionString = sqlConnectString + "Connection
Timeout=30;Connection Lifetime=0;Min Pool Size=0;Max Pool
Size=100;Pooling=true;";
2. //Open connection
A Connection String in the Web.Config file with connection pooling option:
3. <connectionStrings>
4. <clear />
5. <add name="sqlConnectionString" connectionString="Data
Source=mySQLServer;Initial Catalog=myDatabase;Integrated
Security=True;Connection Timeout=15;Connection Lifetime=0;Min
Pool Size=0;Max Pool Size=100;Pooling=true;" />
6. </connectionStrings>
SQL Server connection string pooling attributes:
• Connection Lifetime: Length of time in seconds after creation after which a connection
is destroyed. The default is 0, indicating that connection will have the maximum
timeout.
• Connection Reset: Specifies whether the connection is reset when removed from the
pool. The default is true.
• Load Balance Timeout: Length of time in seconds that a connection can remain idle in a
connection pool before being removed.
• Max Pool Size: Maximum number of connections allowed in the pool. The default is
100.
• Min Pool Size: Minimum number of connections maintained in the pool. The default is
0.
• Pooling: When true, the connection is drawn from the appropriate pool, or if necessary,
created and added to the appropriate pool. The default is true.
See for more detail:
No DataReader DataSet
1 Used in a connected Used in a disconnected
architecture architecture.
2 Provides better performance Provides lower performance.
3 DataReader object has read- A DataSet object has
only access read/write access
4 DataReader object supports a A DataSet object supports
single table based on a single multiple tables from various
SQL query of one database databases.
5 A DataReader object is bound A DataSet object is bound to
to a single control. multiple controls.
6 A DataReader object has A DataSet object has slower
faster access to data. access to data.
7 A DataReader object must be A DataSet object is supported
manually coded. by Visual Studio tools.
8 We can't create a relation in We can create relations in a
a data reader. dataset.
9 Whereas a DataReader A Dataset supports
doesn't support data reader integration with XML Dataset
communicates with the communicates with the Data
command object. Adapter only.
10 DataReader cannot modify A DataSet can modify data.
data.
• The Command Object uses the connection object to execute SQL queries.
• The queries can be in the form of Inline text, Stored Procedures or direct Table access.
• An important feature of Command object is that it can be used to execute queries and
Stored Procedures with Parameters.
• If a select query is issued, the result set it returns is usually stored in either a DataSet or
a DataReader object.
The three important methods exposed by the SqlCommand object is shown below:
• ExecuteScalar
• ExecuteNonQuery
• ExecuteReader
ExecuteScalar is useful for returning a single value from the database. For example, using this
method we can retrieve a sum of sales made by a specific product, total number of records in
the employee table, unique id by supplying filtering conditions and so on. Since this method
performs faster we do not need to go for the Reader method just to retrieve a single scalar
value.
ExecuteNonQuery is useful for performing data manipulation on the database. Simply, the
ExecuteNonQuery is for executing the DML statements. The return value of the
ExecuteNonQuery is an integral value that represents the number of rows affected by the
Operation.
ExecuteReader is used when we need to retrieve rows and columns of data using the SQL select
statements. As the data retrieved is a table of data, ExecuteReader returns SqlDataReader. We
should iterate through this object to get the required values.
• What is ADO.NET?
Question 8: What is the DataAdapter Object in ADO.NET?
Answer 8: A Data Adapter represents a set of data commands and a database connection to fill
the dataset and update a SQL Server database.
A Data Adapter contains a set of data commands and a database connection to fill the dataset
and update a SQL Server database. Data Adapters form the bridge between a data source and a
dataset.
Data Adapters are designed depending on the specific data source. The following table shows
the Data Adapter classes with their data source.
• Fill (): The Fill method populates a dataset or a data table object with data from the
database. It retrieves rows from the data source using the SELECT statement specified
by an associated select command property.
The Fill method leaves the connection in the same state as it encountered before
populating the data.
• Update (): The Update method commits the changes back to the database. It also
analyzes the RowState of each record in the DataSet and calls the appropriate INSERT,
UPDATE, and DELETE statements.
Example:
Answer
Example
Answer
Property Description
Depth Indicates the depth of nesting for row
FieldCount Returns number of columns in a row
IsClosed Indicates whether a data reader is closed
Item Gets the value of a column in native format
RecordsAffected Number of row affected after a transaction
Property Description
Close Closes a DataRaeder object.
Read Reads next record in the data reader.
NextResult Advances the data reader to the next result
during batch transactions.
Getxxx There are dozens of Getxxx methods. These
methods read a specific data type value from
a column. For example. GetChar will return a
column value as a character and GetString as
a string.
• DataReader in ADO.NET
Answer: CommandBuilder helps you to generate update, delete, and insert commands on a
single database table for a data adapter. Similar to other objects, each data provider has a
command builder class. The OleDbCommandBuilder, SqlCommonBuilder, and
OdbcCommandBuilder classes represent the CommonBuilder object in the OleDb, Sql, and
ODBC data providers.
• CommandBuilder in ADO.NET
Answer : A Connection object sits between a data source and a DataAdapter (via Command).
You need to define a data provider and a data source when you create a connection. With
these two, you can also specify the user ID and password depending on the type of data source.
Figure 3-3 shows the relationship between a connection, a data source, and a data adapter.
Figure: The relationship between connection, data Adapter, and a data source.
Connection can also be connected to a Command object to execute SQL queries, which can be
used to retrieve, add, update and delete data to a data source. Figure 2 shows the relationship
between the Command and Connection objects.
Answer: A DataView enables you to create different views of the data stored in a DataTable, a
capability that is often used in data binding applications. Using a DataView, you can expose the
data in a table with different sort orders, and you can filter the data by row state or based on a
filter expression. A DataView provides a dynamic view of data whose content, ordering, and
membership reflect changes to the underlying DataTable as they occur. This is different from
the Select method of the DataTable, which returns a DataRow array from a table per particular
filter and/or sort order and whose content reflects changes to the underlying table, but whose
membership and ordering remain static. The dynamic capabilities of the DataView make it ideal
for data-binding applications.
There are two ways to create a DataView. You can use the DataView constructor, or you can
create a reference to the DefaultView property of the DataTable. The DataView constructor can
be empty, or will also take either a DataTable as a single argument, or a DataTable along with
filter criteria, sort criteria, and a row state filter.
• DataView in C#
Answer:
ExecuteScalar Method
The ExecuteScalar method of the SqlCommand object is useful for retrieving a single value from
the database. In our example, we need to retrieve the total number of records in the Titles
table of the Pubs database. Since the total number of records is a single scalar value, the
Execute Scalar method is used. The following is the code and its explanation:
• AcceptChanges(): This method saves changes which are made with records in a DataSet.
• Clone(): The clone method copy the structure of DataSet. Means it copy only schema
not full records of DataSet.
• HasChanges(): This method return boolean value to show whether record of DataSet
has changed or not. It returns true if any changes has made and false if no other
changes made.
• GetChanges(): This method keep copy of those record, which is changed or modified.
See for more detail:
Answer: Parameters in conjunction with SelectCommand to help you Select data for the
DataSet.
The OleDbType describes the type information for the parameter. It consists of everything from
strings to Global Unique Identifiers (GUIDs). SQL data provider has SqlDbType, and ODBC data
provider has an ODBC type. These type names and definitions differ depending upon the
provider you're using. For example, the Money type is the same in ODBC and Sqldata providers,
but is called Currency in OleDb data providers.
Property Description
DbType Represents the DbType of the parameter.
Direction Represents the direction of a parameter. A
parameter can be input-only, output-only, bi-
directional, or a stored procedure.
IsNullable Represents whether a parameter accepts null
values.
OleDbType Represents the OleDbType of the parameter.
ParameterName Represents the name of the parameter.
Precision Represents the maximum number of digits
used to represent the Value property.
Scale Represents the decimal places to which Value
is resolved.
Size Represents the maximum size in bytes a
column can store.
SourceColumn Represents the source column mapped to the
DataSet.
SourceVersion Represents the DataRowversion.
Value Represents the Value of the parameter.
Creating a parameter
this.oleDbDeleteCommand2.Parameters.Add(newSystem.Data.OleDb.OleDbParameter("Contac
tName", System.Data.OleDb.OleDbType.char, 30, System.Data.ParameterDirection.Input, false,
(( system.Byte)(0)),((System.Byte)(0)), "Contact Name", System.Data.DataRowVersion.Original,
null));
• Parameters in ADO.NET
Answer:
DataReader
66. The ADO.NET DataReader is used to retrieve read-only (cannot update data back to
datasource) and forward-only (cannot read backward/random) data from a database.
67. Using the DataReader increases application performance and reduces system
overheads. This is due to one row at a time is stored in memory.
70. You need to open and close the connection manually in code.
DataSet
71. The DataSet is a in-memory representation of data.
72. It can be used with multiple data sources. That is a single DataSet and can hold the data
from different data sources holding data from different databases/tables.
73. The DataSet represents a complete set of data including related tables, constraints, and
relationships among the tables.
74. The DataSet can also persist and reload its contents as XML and its schema as XML
Schema definition language (XSD) schema.
75. The DataAdapter acts as a bridge between a DataSet and a data source for retrieving
and saving data.
76. The DataAdapter helps mapping the data in the DataSet to match the data in the data
source.
77. Also, upon an update of dataset, it allows changing the data in the data source to match
the data in the DataSet.
79. Hence, point (8) says that it is a disconnected architecture. Fill the data in DataSet and
that's it. No connection existence required.
See for more detail:
• DataReader Vs DataSet?
Answer 20: The ExecuteNonQuery method is used to execute the command and return the
number of rows affected.
Answer: SqlConnection class is used to establish the connection between front end and back
end.
Syntax:
• Overview Of ADO.NET
Answer: ADO.NET is a set of classes (a framework) to interact with data sources such as
databases and XML files. ADO is the acronym for ActiveX Data Object. It allows us to connect to
underlying data or databases. It has classes and methods to retrieve and manipulate data.
The following are a few of the .NET applications that use ADO.NET to connect to a database,
execute commands and retrieve data from the database.
To create a connection, you must be familiar with connection strings. A connection string is
required as a parameter to SQLConnection. A ConnectionString is a string variable (not case
sensitive).
This contains key and value pairs, like provider, server, database, userid and word as in the
following:
• Basics of ADO.NET
Answer: The SqlTransaction class is an important class of .NET Framework. It ensures that a
body of code will affect a Database or kept the same as previous (Rollback).
At first we should know about it's two most important method which will be used here. They
are given below.
• Rollback(): It is used to rollback the transaction. It set the database in previous stage
which was, before the begin of transaction.
See for more detail:
• Data reader
• Data set
DataReader Class:
The DataReader class object allows you to read the data returned by a SELECT command by a
simple forward-only and read-only cursor. It requires a live connection with the data source and
provides a very efficient way of looping and consuming all parts of the result set. The object of
the DataReader cannot be directly instantiated. Instead you must call the ExecuteReader
method of the Command object and close the connection when you are done using the
DataReader otherwise the connection remains alive until it is explicitly closed.
Answer: A DataAdapter bridges the gap between the disconnected DataTable objects and the
physical data source. The SqlDataAdapter is capable of executing a SELECT, DELETE and UPDATE
statement on a data source as well as extracting input from the result set into a DataTable
object. The SqlDataAdapter class provides a method called Fill() to copy the result set into the
DataTable.
Property Description
SelectCommand This command executed to fill in a Data Table
with the result set.
InsertCommand Executed to insert a new row to the SQL
database.
UpdateCommand Executed to update an existing record on the
SQL database.
DeleteCommand Executed to delete an existing record on the
SQL database.
Answer: ADO.NET is a collection of managed libraries used by .NET applications for data source
communication using a driver or provider.
ADO.NET provides libraries for the datasource communication under the following namespaces.
138. system.Data
139. system.Data.OleDb
140. system.Data.SqlClient
141. system.Data.OracleClient
142. system.Data.Odbc
143. System.Data: This namespace is used for holding and managing data on a client
machine.
144. System.Data.OleDb: This namespace can communicate with any data source like
files, databases, indexing servers and so on using the “OleDb” Provider.
147. System.Data.ODBC: This namespace contains the same set of classes as the
following:
o Connection
o Command
o DataReader
o DataAdaptar
o CommandBuilder
o Parameter
See for more detail:
• Introduction To ADO.NET
Answer: The command object is one of the basic components of ADO .NET.
148. The Command Object uses the connection object to execute SQL queries.
149. The queries can be in the form of Inline text, Stored Procedures or direct Table
access.
150. An important feature of Command object is that it can be used to execute
queries and Stored Procedures with Parameters.
151. If a select query is issued, the result set it returns is usually stored in either a
DataSet or a DataReader object.
Now, let us have a look at various execute methods that can be called from a Command Object.
Property Description
ExecuteNonQuery This method executes the command specifies
and returns the number of rows affected.
ExecuteReader The ExecuteReader method executes the
command specified and returns an instance
of instance of SqlDataReader class.
ExecuteScalar This method executes the command
specified and returns the first column of first
row of the result set. The remaining rows and
column are ignored
ExecuteXMLReader This method executes the command
specified and returns an instance of
XmlReader class. This method can be used to
return the result set in the form of an XML
document
Answer:
The ExecuteScalar Method in SqlCommandObject returns the first column of the first row after
executing the query against the Data Source.
156. If the result set contain more than one column or rows, it takes only the first
column of the first row. All other values are ignored.
Using the XmlDocument class we load the XmlReader object and save it to the File System using
the Save method.
Answer:
Property Example
SelectCommand cmd.SelectCommand.CommandText =
"SELECT * FROM Orders ORDER BY Price"
DeleteCommand TheDataSetCommand.DeleteCommand.Com
mandText = "DELETE FROM orders WHERE
LastName = 'Smith' ";
InsertCommand TheDataSetCommand.InsertCommand.Comm
andText = "INSERT INTO Orders VALUE (25,
'Widget1', 'smith')";
UpdateCommand TheDataSetCommand.UpdateCommand.Com
mandText = "UPDATE Orders SET ZipCode =
'34956' WHERE OrderNum = 14";
The OLEDb Data Adapter methods
Method Description
Fill This method fills data records from a
DataAdapter to a DataSet object.
FillSchema This method adds a DataTable to a DataSet.
GetFillParameters This method retrieves parameters that are
used when a SELECT statement is executed.
Update This method stores data from a data set to
the data source.
Create a button, set it's text as Clear and write the following code in the click event.
Answer: The clone method copy the structure of DataSet. Means it copy only schema not full
records of DataSet.
Take another DataGridView and one button in your project and write the following code on
button click event.
186. private void btnclone_Click(object sender, EventArgs e)
187. {
188. DataSet daset = ds.Clone();
189. dataGridView2.DataSource = daset.Tables[0];
190. }
Now run the application.
Output
Click the "Clone" button. The following figure shows that only structure has copied.
See for more detail:
Take a button and set it's text as copy and write the following code on click event.
Output
Click the copy button.
Answer: This method return boolean value to show whether record of DataSet has changed or
not. It returns true if any changes made and false if no changes performed.
Take a button and set it's text as "HasChanges" and write the following code on button click.
Output
Now click at "HasChanges" button after doing some changes in dataset record.
Output
Answer: The Connection class has a connection string that opens a connection to the database.
The connection string will vary depending upon the provider used. The connection strings
typically contain a group of property-value pair to describe how to connect to a database. For
an OleDbConnection, you have properties such as Provider and DataSource.
Property Description
ConnectionString Represent the connection string.
ConnectionTimeOut Waiting time while establishing a connection.
DataBase Name of the current database.
DataSource Location of the file name of the data source.
Provider Name of the OLE DB provider. This property
is not available for Sql and ODBC data
providers.
State Current state of the connection of type
ConnectionState. (Table 5-17 describes the
ConnectionState).
PacketSize Size of network packets. Available to only Sql
data providers.
ServerVersion SQL server version. Available to only Sql data
providers.
WorkStationId Database client ID. Available to only Sql data
providers.
The connection can have different states such as open, closed, connecting, and so on. The
ConnectionType enumeration defines the members of the ConnectionState.
Method Description
BeginTransaction Begins database transaction.
ChangeDatabase Changes databases for an open connection.
Close Closes an opened connection.
CreateCommand Creates and return a Command object
depends on the data providers. For example,
OleDb Connection returns OleDbCommand,
and SqlConnection returns SqlCommand.
Open Open a new connection.
ReleaseObjectPool Represents that the connection pooling can
be cleared when the provider is released.
Available only for Ole Db data providers.
• Connecting to the Database in ADO.NET
Answer: The preferred method is to use the SqlParameter and oleDbParameter objects, as
detailed in the section "Using Parameters with the command Object."
Answer : DataSet is good for ADO.NET objects to replace the ADO Recordset object:
Answer: Transactions: ADO.NET providers a transaction class that represents a transaction. All
data providers provide their own version of the transaction class. The IDbTransaction interface
implements the basic functionality of the transaction class. All data provider-specific classes
implement this namespace.
Method Description
Commit Commits the transaction to the database
Rollback Rollbacks a transaction to the previous
database state
Begin(IsolationLevel) Begins a nested database transaction passing
the isolation level
Concurrency in ADO.NET
The ADO.NET model assumes that the optimistic concurrency is the default concurrency
because of its disconnected nature of data. A user reads data in a data through a data adapter,
and data is available to user as a local copy of the data. The server database is available to all
other users.
Another way of handling optimistic concurrency that you may be familiar with is by checking to
see if a timestamp on the data source row has changed or the row version number has changed
on the row being updated.
Pessimistic locking on the database isn't really supported by the data providers because the
connection to the database is not kept open, so you must perform all locking with business
logic on the DataSet.
218. SQL Server: It is used to work specifically with Microsoft SQL Server. It exists in a
namespace within the System.Data.SqlClient.
219. OLE DB: It is used to work with the OLEDB provider. The System.Data.dll
assembly implements the OLEDB .NET framework data provider in the
System.Data.OleDb namespace.
220. ODBC: To use this type of provider, you must use an ODBC driver. The
System.Data.ODBC.dll assembly implements the ODBC .NET framework data provider.
This assembly is not part of the Visual Studio .NET installation.
• Introduction to ADO.Net
Question 43: How can we Create and Manage Connections In
ADO.NET?
ConnectionString: It provides information, such as database name and user credentials for
database access and so on.
Open(): Opens the connection for accessing the database.
Close(): Closes the connection to the database.
For Example:
• Introduction to ADO.Net
Answer: A data representation, such a DataSet, that doesn't require a continuous database
connection. Working with disconnected data:
The data in DataSet is disconnected from database. Once you fetch the results of a query into a
DataSet using a DataAdapter object, there is no longer a connection between DataSet and
database. Changes you make to the contents of the DataSet will not affect the database. If
other users modify data in database that corresponds to the data in DataSet, you will not see
those changes in your DataSet.
Working with disconnected data structures definitely has its benefits. The first major benefit of
working with disconnected data is that it does not require a live connection to your database.
Once you've fetched the results of your query into a DataSet object, you can close the
connection to your database and continue to work with the data in your DataSet.
Disconnected data structures such as DataSets are also helpful when you build multi-tiered
applications. If your application uses business objects running on a middle-tier server to access
database, business object needs to pass disconnected data structures to client application. The
DataSet object is designed for use in such situations. You can pass the contents of a DataSet
from one component to another. The component that receives the data can work with the
information as a DataSet (if the component is built using the Microsoft .NET Framework) or as
an XML document.
See for more detail:
Answer: A DataTable object represents a database table. A data table is a collection of columns
and rows. The DataRow object represents a table row, and the DataColumn object represents a
column of the table.
The Columns property of the DataTable object represents the DataColumnCollection, which is a
collection of DataColumn objects in a DataTable. You use a DataRow object to add data to a
data table. TheDataRowCollection object represents a collection of rows of a DataTable object,
which can be accessed by its Rows property.
Figure shows the relationship between the DataTable, DataRow, and DataColumn.
Summary of the evolution of the database objects to access data from Microsoft:
ADO.NET provides a single object-oriented set of classes. There are different data providers to
work with different data sources but the programming model for all these data providers work
in the same way.
Managed Code
The ADO.NET classes are managed classes. CLR takes care of language independency and
automatic resource management.
Deployment
Microsoft uses MDAC (Microsoft Data Access Component), which is used as ActiveX component
in .NET Framework (X is extensible component, when X is written after a term means
extensible). .NET components takes care of deployment which was difficult than the previous
technologies used in deployment.
XML Support
ADO.NET data is cached and transferred in XML (EXtensible Markup Language) format. XML
provide fast access of data for desktop and distributed applications.
Performance and scalability are two major factors while developing web-based application and
services. Disconnected cached data in XML help in performance and scalability.
• What is ADO.NET?
Answer: The GetChanges method of DataSet can be used to retrieve the rows that have been
modified since the last time DataSet was filled, saved or updated. The GetChanges method
returns a DataSet object with modified rows.
The GetChanges method can take either no argument or one argument of type DataRowState.
The DataRowState enumeration defiles the DataRow state, which can be used to filter a
DataSet based on the types of rows.
DataRowState members
Member Description
Added Add added rows to a DataRowCollection of a
DataSet and AcceptChanges has not been
called.
Deleted All the deleted rows.
Detached Rows were created but not added to the row
collection. Either waiting for the addition or
have removed from the collection.
Modified Modified rows and AcceptChanges has not
been called.
Unchanged Unchanged rows since last AcceptChanges
was called.
Question 49: How can you access the data from DataReader?
Answer: DataReader is a class that holds data as rows and coloums to access data from the
DataReader.
The return type of this method is a string, it returns the name of the column for the
given index position.
247. Read()
Moves the Record Pointer from the current location to the next row and returns a
Boolean status that tells whether the row to which we have moved contains data in it
or not, that will be true if present or false if not present.
Returns a column's value from the row to which the pointer was pointing by specifying
the column index position.
249. NextResult ()
Moves the record pointer from the current table to the next table if a table exists and
returns true else returns false.
Features of Data Reader
250. Provides faster access to data from a Data Source, since it is connection oriented.
251. It can hold multiple tables at a time. To load multiple tables into a DataReader
pass multiple select statements as the argument to the command separated by a colon
(;).
For example:
Answer: The BindingSource class is used to simplify data binding as well as various operations
on records. It has different methods like AddNew( ), MoveFirst( ), MovePrevious( ), MoveNext(
), etc which provide easier way for adding new row, moving to first record, moving to previous
record, moving to next record and many other operations without writing code for them.