5 Working With Database

NET Centric Computing · Unit 5 · 6 hrs

Working with Database

Exam-focused notes for Working with Database (NET Centric Computing, CSC378): 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 basics: Connection, Command, Reader and Adapter classes
  • Entity Framework (EF) Core
  • Object-Relational Mapper (ORM)
  • Adding EF Core to an application: Choosing database provider, data models and data context
  • Querying and Saving data to database: Create, read, update and delete records

ADO.NET basics

208110 marks

List some advantages of Entity Framework over ADO.NET. Assume a database named 'IOST' with a table FACULTY(Course_Name, CourseID, No_of_Semester, fee). Insert some records using ADO.NET and retrive the fee of records having name CSIT.[10]

--- Entity Framework (EF) is an Object/Relational Mapping (O/RM) framework that is an enhancement to ADO.NET giving developers an automated mechanism for accessing and storing data in the database. Advantage of Entity Framework ADO.NET Limitation ----------...

Full solved answer →
20805 marks

What is the role of adapter class in ADO.NET? List some features of URL routing. [5]

--- The DataAdapter class in ADO.NET acts as a bridge between a DataSet and a data source (such as a SQL Server database). It is found in the System.Data.SqlClient namespace (e.g., SqlDataAdapter). Role Description ------------------- Fill Retrieves data fr...

Full solved answer →
20795 marks

Write an ADO. Net application to read the data from the existing table MOVIE(id, name, genre), where genre is 'comedy'. [5]

- Table: MOVIE(id, name, genre) - Filter condition: genre = 'comedy' - Task: Read (SELECT) matching rows using ADO.NET This is a programming/theory question, so there are no numeric inputs to extract. All required information is present. --- ADO.NET connect...

Full solved answer →
20765 marks

What is ADO in ASP?[5]

ADO is a Microsoft technology used in Active Server Pages (ASP) to connect web applications to databases. It provides a set of COM-based objects that allow developers to access and manipulate data stored in databases (such as MS Access, SQL Server, Oracle, ...

Full solved answer →

Object-Relational Mapper

20815 marks

What is the task of ORM? Discuss about open redirect attacks. [5]

--- ORM (Object-Relational Mapper) is a programming technique that maps objects in an application to tables in a relational database. Its primary tasks include: - Data Mapping: Maps class properties to database table columns, so developers work with objects...

Full solved answer →

Querying and Saving data to database

208010 marks

How do you cache the information of the client and what are its uses? Create a table named BAG(ID, Brand, Price, Date). Perform the following operations using Entity Framework Core. a. Update the Price of those Book to 2000 which are published on 2022. b. Delete the Book which are published in 1981. c. Retrieve the Brand of Book having price greater than 500.[10]

--- Caching is the technique of storing frequently accessed data temporarily in fast-access memory so that subsequent requests can be served without repeatedly querying the database or recomputing results. In web applications (ASP.NET Core), caching client ...

Full solved answer →

Adding EF Core to an application

20785 marks

Define data model and data context. What does URL routing mean? [5]

--- According to Entity Framework Core, a data model (also called Entity Data Model) is the model that Entity Framework uses to communicate with the underlying database. It is built based on the shape of domain classes, Data Annotations, and Fluent API conf...

Full solved answer →