Mention the usage of Connection Object in ADO.NETConnection object is used to establish a connection between your .NET application and the database used by your application.
If you have to manipulate data from the database using ADO.NET, you have to follow the steps shown below: Create
a connection You have to ensure that you close the connection as soon as you finish your tasks related to the database. This makes your application run faster and allows the database to be used by multiple resources of your application. Two different types of connection object exist in ADO.NET. They are mentioned below: SqlConnection:
Available in the namespace System.Data.SqlClient. It is used to connect
to SQL Server database with version 7.0 or higher. Apart from
creating and opening a connection, several other methods exist in a connection
object. Methods associated with Connection Object are: BeginTrans, Cancel,
Close, CommitTrans, Execute, Open, OpenSchema and RollbackTrans. With
these methods, you can manage your transaction and you can even rollback
from your current transaction. Connection object also includes several
properties, events and collections.
|