[ ASP.NET WebForm C# ] Oracle CRUD Operations Tutorial – Overview

ASP.NET is a web application framework developed by Microsoft to allows web developer to build dynamic web sites or web applications easily. It allows you to use a full featured programming language such as C-Sharp (C#) or Visual Basic (VB).

  • This tutorial covers all the basic elements of ASP.NET and C# programming language that a beginner would require to get started.
  • This tutorial is intended for understanding of Create, Read, Update and Delete (CRUD) operation in ASP.NET and using Oracle as database.
  • In this tutorial, I will explain how to :
  1. Create a new ASP.NET WebForm project.
  2. Setup project
  • add libraries such as bootstrap, jQuery, Font-awesome, SeetAlert2
  • add NuGet package for Oracle.ManagedDataAccess
  • add database connection
  1. Create new MasterPage contains logo and navigation bar with menu
  2. Create new WebForm (Main page) contains header (<h1>) and welcome message
  3. Create new WebForm (Customers page) contains header (<h3>), textbox and button for searching record.
  4. Add SqlDataSource and GridView.
  5. Show list of records in GridView,
  6. Search records from database and show as list of records in GridView,
  7. Create new WebForm (CustomerDetails page) contains header (<h3>), label, textbox and button for CRUD operation.
  8. Insert new record into database,
  9. Show record details,
  10. Update record into database,
  11. Delete record from database (directly from Gridview and from page record details).

To explain further about how to bind data in asp.net gridview and perform insert, update and delete operations, we need to create database table to read data and bind retrieved result set into gridview, so simply execute SQL scripts to SQL editor to create database table and then add few records manually or download complete example code with script at the end of this page. Hope you already have the database knowledge including creating tables, creating sequence, creating trigger and writing queries. You need to add ConnectionString in Web.config according to your database settings.

It is easier to understand this tutorial if you have the following basic knowledge:

  • Visual Studio / Visual Web developer (it would be nice if you have latest version)
  • .NET Framework (it would be nice if you have latest version)
  • Oracle + Oracle GUI Tool (it will be easy for you if you have Oracle GUI tool)
  • Basic knowledge of SQL, ASP.NET and C#

Here, I’ll not cover development of an attractive User Interface. I will only focus on how Oracle CRUD operations can be performed in ASP.NET C#.

Let’s start with the use case scenario and screenshot.

Use Case Scenario

This will allows user to:

  1. list all records
  2. find records
  3. add new record
  4. view a record details
  5. update record
  6. delete record

An alert will be display on each operation. Also will validate each of mandatory fields.

Screenshot