3 Data Access With Ado Net And Entity Framework

NET Centric Computing · Unit 3

Data Access with ADO.NET and Entity Framework

Exam-focused notes for Data Access with ADO.NET and Entity Framework (NET Centric Computing, BIT351): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.

What this unit covers

  • ADO.NET architecture
  • DataReader and DataAdapter classes
  • CRUD operations with ADO.NET
  • Object-Relational Mapping concepts
  • Entity Framework advantages
  • Data models and DbContext
  • LINQ queries with Entity Framework

Entity Framework advantages

20815 marks

List the advantages of Entity framework over ADO.NET. [5]

Note: The reference notes did not contain this topic directly. The following answer is based on standard .NET curriculum content appropriate for BSc CSIT. --- Entity Framework (EF) is an Object-Relational Mapper (ORM) built on top of ADO.NET that allows dev...

Full solved answer →

CRUD operations with ADO.NET

20815 marks

Given a table BOOK(ISBN,Name,Author,Price), write a program to update the price of the book to 1000 whose author is John. [5]

The table is BOOK(ISBN, Name, Author, Price) and the requirement is a single row update: every book whose Author is John must end up with Price set to 1000. The database work itself is one SQL statement. BIT351 is a .NET paper, so the program that carries t...

Full solved answer →

Data models and DbContext

20805 marks

Describe about data models and data context. [5]

A data model is a collection of conceptual tools used to describe data, data relationships, data semantics, and consistency constraints. It provides a way to describe the design of a database at the logical and physical levels. - Data is organized in a tree...

Full solved answer →

Object-Relational Mapping concepts

20805 marks

What us the purpose of object relational mapper? Describe. [5]

--- An Object Relational Mapper (ORM) is a programming technique and tool that acts as a bridge between an object-oriented programming language and a relational database. It allows developers to interact with a database using objects and classes instead of ...

Full solved answer →
05 marks

Describe about ORM. [5]

--- Object-Relational Mapping (ORM) is a programming technique that allows developers to interact with a relational database using an object-oriented paradigm. It creates a "virtual object database" that can be used from within a programming language, elimi...

Full solved answer →

DataReader and DataAdapter classes

2081.110 marks

Why do we need reader and adapter class? Using ADO.NET, in a relation BOOK (id, author, name, price), delete the books having price less than 500.[10]

- Relation: BOOK (id, author, name, price) - Task: Delete books where price < 500 - Conceptual question: Need for DataReader and DataAdapter classes No numeric matrices or scheduling data involved. This is a conceptual + programming question. All required i...

Full solved answer →

LINQ queries with Entity Framework

010 marks

Assume a database named 'Library' with relation Book(Id, Name, Price, Author, Pub_Date). Write a program to insert the records of 10 books and retrieve those books which are published in 2022 using Entity Framework.[10]

Database: Library Relation: Book(Id, Name, Price, Author, PubDate) Attributes: - Id - identifier (primary key, integer) - Name - book name (string) - Price - price (numeric) - Author - author name (string) - PubDate - publication date (date) Tasks: 1. Inser...

Full solved answer →