Skip to main content

What is Microsoft ADO.NET?

What is Microsoft ADO.NET?

ADO.NET is one of the Component in the Microsoft.NET framework which contains following features to Windows, web and distributed applications.
i. Data Access to the applications from Database in connected (Data reader object) and disconnected (Data set and data table) model.
ii. Modify the data in database from application.

What are the Benefits of ADO.Net?

ADO.Net offers following Benefits

Interoperability: 

XML Format is one of the best formats for Interoperability.ADO.NET supports to transmit the data using XML format.

Scalability: 

ADO.NET works on Dataset that can represent a whole database or even a data table as a disconnected object and thereby eliminates the problem of the constraints of number of databases being connected. In this way scalability is achieved.

Performance: 

The performance in ADO.NET is higher in comparison to ADO that uses COM marshalling.

Programmability:

ADO.Net Data components in Visual studio help to do easy program to connect to the database.

Explain different connection objects used in ADO.NET? 

Sql connection object used to connect to a Microsoft SQL Server database. SQL database connections use the Sql Data Adapter object to perform commands and return data.
Oracle Connection object used to connect to Oracle databases. Oracle database connections use the Oracle Data Adapter object to perform commands and return data. This connection object was introduced in Microsoft .NET Framework version 1.1.
Ole Db Connection object used to connect to a Microsoft Access or third-party database, such as My SQL. OLE database connections use the Ole Db Data Adapter object to perform commands and return data.

What are the different steps to access a database through ADO.NET?

·         Create a connection to the database using a connection object.
·         Open the Database Connection.
·         Invoke a command to create a Dataset object using an adapter object.
·         Use the Dataset object in code to display data or to change items in the database.
·         Invoke a command to update the database from the Dataset object using an adapter object.
·         Close the database connection.

What is the difference between Data Reader and Data Adapter?

·         Data Reader is read only forward only and much faster than Data Adapter.
·         If you use Data Reader you have to open and close connection explicitly where as if you use Data Adapter the connection is automatically opened and closed.
·         Data Reader  expects connection to database to perform any operation on data where as Data Adapter is disconnected

What is the difference between Execute Reader, Execute Scalar and Execute Non Query methods?

Execute Reader

Execute Reader will be used to return the set of rows, on execution of SQL Query or Stored procedure using command object.
Execute Scalar

Execute Scalar will be used to return the single value, on execution of SQL Query or Stored procedure using command object.
Execute Non Query

If the command or stored procedure performs INSERT, DELETE or UPDATE operations, then we use Execute Non Query method. Execute Non Query method returns an integer specifying the number of rows inserted, deleted or updated.



Comments

Popular posts from this blog

.NET Core API With Dapper, Repository And UnitOfWork

  Introduction In this tutorial, you will use ASP.NET Core Web API to create a web API that returns a list of brands. This article focuses on creating web API using dapper, repository pattern, and UnitOfWork pattern in .NET 8. I will guide you through the steps by step to create web API. HTTP is not just for serving up web pages. HTTP is also a powerful platform for building APIs that expose services and data. HTTP is simple, flexible, and ubiquitous. Almost any platform that you can think of has an HTTP library, so HTTP services can reach a broad range of clients, including browsers, mobile devices, and traditional desktop applications. ASP.NET Core Web API is a framework for building web APIs on top of the .NET Framework. Creating a New Project in Visual Studio Launch Visual Studio and select Create a New Project. Creating a Core Web API Start Visual Studio and choose Create a new project. In the Create a new project dialog, select ASP.NET Core Web API Click Next. Configuring You...

.Net framework interview questions

What is the .NET Framework? The .NET Framework is a set of technologies that form an integral part of the .NET Platform. It is Microsoft’s managed code programming model for building applications. The .NET Framework has two main components: Common Language Runtime (CLR): The CLR is one of the foundation in the .NET framework and provides a common set of services for applications developed on Microsoft .Net Technologies. .NET Framework class library: The .NET framework class library is a collection of reusable types and exposes features of the runtime. It contains of a set of classes that is used to access common functionality. What is CTS (Common Type System)? The common type system (CTS) defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime’s support for cross-language integration. The common type system performs the following functions: ·          Establishes a framework that...

Move Selected Gridview Rows to Another Gridview in Asp.net

Introduction :  Here I will explain how to move or transfer selected checkbox gridview rows to another  grid v iew in asp.net using c#, vb.net or copy one gridview row to another gridview in asp.net using c#, vb.net. Description :  In previous posts I explained Display images in gridview from database in asp.net, Enable/Disable checkbox in gridview based on condition,  asp.net gridview examples  and  bind data to textbox control in gridview ,  Bind data to dropdownlist  in gridview  and many articles relating to  asp.net,  c#, vb.net, c#,vb.net. Now I will explain how to move selected rows from one gridview to another gridview in asp.netusing c#, vb.net. To implement this first we need to write the code in aspx page like this  < html   xmlns ="http://www.w3.org/1999/xhtml"> < head > ...