<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4" -->

---
title: CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET...
description: You can build a full Employee CRUD app in ASP.NET Web Forms on .NET Framework 4.8 using plain ADO.NET and SQL Server, with no Entity Framework. The data access...
canonical: https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET Framework 4.8) | daily.dev
og:description: You can build a full Employee CRUD app in ASP.NET Web Forms on .NET Framework 4.8 using plain ADO.NET and SQL Server, with no Entity Framework. The data access...
og:url: https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4
og:image: https://api.daily.dev/og/posts/TmhLHkCt4.png
og:image:alt: CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET Framework 4.8)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET Framework 4.8)

**[C\# Corner](https://daily.dev/sources/csharpcorner)** · 5 min read · 0 upvotes · 0 comments

## Summary

You can build a full Employee CRUD app in ASP.NET Web Forms on .NET Framework 4.8 using plain ADO.NET and SQL Server, with no Entity Framework. The data access layer is a single EmployeeDAL class with five methods: get all, get by id, insert, update and delete. It uses SqlConnection, SqlCommand, SqlDataAdapter and SqlDataReader. Queries are parameterized to prevent SQL injection, and using blocks dispose database resources. The steps cover the SQL script, project setup, a Web.config connection string and an Employee model. The web form itself is only introduced.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.c-sharpcorner.com/article/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8>

## Questions this post answers

### How do I do CRUD in ASP.NET Web Forms on .NET Framework 4.8 without Entity Framework?

Use ADO.NET directly and put the database code in a separate data access class. An EmployeeDAL class can expose five methods: GetAllEmployees, GetEmployeeById, InsertEmployee, UpdateEmployee and DeleteEmployee. Each uses SqlConnection and SqlCommand with a connection string from Web.config, and the web form calls these methods for its Create, Read, Update and Delete actions.

_Developers maintaining legacy .NET Framework apps keep up with ADO.NET and Web Forms patterns on daily.dev._

### How do I prevent SQL injection and leaked connections when using ADO.NET in C#?

Use parameterized queries and wrap database objects in using blocks. Parameters are added with cmd.Parameters.Add using a SqlDbType, such as SqlDbType.Int for an Id or NVarChar with a length for text. The using blocks around SqlConnection, SqlCommand, SqlDataAdapter and SqlDataReader ensure resources are disposed even when an error occurs.

_Developers hardening data access code follow ADO.NET and SQL injection guidance on daily.dev._

## Similar posts on daily.dev

- [Building CRUD API with Dapper and Dapper Plus in ASP.NET Core](https://daily.dev/posts/building-crud-api-with-dapper-and-dapper-plus-in-asp-net-core-pzojrv4vq) · We Are .NET · 0 upvotes · 0 comments
- [Creating a Production-Ready CRUD Application in ASP.NET Core](https://daily.dev/posts/creating-a-production-ready-crud-application-in-asp-net-core-1mfpkrepl) · Telerik · 0 upvotes · 0 comments
- [How to Work With Dapper in .Net](https://daily.dev/posts/how-to-work-with-dapper-in-net-yzgrlyllb) · freeCodeCamp · 17 upvotes · 0 comments
- [Dapper in Depth with ASP.NET Core 10](https://daily.dev/posts/dapper-in-depth-with-asp-net-core-10-oad4bk2bw) · C\# Corner · 1 upvotes · 0 comments
- [Session Recording](https://daily.dev/posts/session-recording-mqjl5rcuk) · The Daily WTF · 0 upvotes · 0 comments

---

Tags: [#c#](https://daily.dev/tags/c#), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server)

[View this post on daily.dev](https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET Framework 4.8)","url":"https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4"},"datePublished":"2026-11-28T09:47:19.079Z","dateModified":"2026-11-28T09:48:18.803Z","description":"You can build a full Employee CRUD app in ASP.NET Web Forms on .NET Framework 4.8 using plain ADO.NET and SQL Server, with no Entity Framework. The data access...","image":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","thumbnailUrl":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","isAccessibleForFree":true,"articleSection":"C# Corner","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"C# Corner","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ada2d584df6241748fc4e71878dc70a3","url":"https://daily.dev/sources/csharpcorner"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c#,microsoft-sql-server","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"C# Corner","item":"https://daily.dev/sources/csharpcorner"},{"@type":"ListItem","position":3,"name":"CRUD Operations Using ADO.NET in ASP.NET Web Forms (.NET Framework 4.8)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/crud-operations-using-ado-net-in-asp-net-web-forms-net-framework-4-8--tmhlhkct4#faq","mainEntity":[{"@type":"Question","name":"How do I do CRUD in ASP.NET Web Forms on .NET Framework 4.8 without Entity Framework?","acceptedAnswer":{"@type":"Answer","text":"Use ADO.NET directly and put the database code in a separate data access class. An EmployeeDAL class can expose five methods: GetAllEmployees, GetEmployeeById, InsertEmployee, UpdateEmployee and DeleteEmployee. Each uses SqlConnection and SqlCommand with a connection string from Web.config, and the web form calls these methods for its Create, Read, Update and Delete actions. Developers maintaining legacy .NET Framework apps keep up with ADO.NET and Web Forms patterns on daily.dev."}},{"@type":"Question","name":"How do I prevent SQL injection and leaked connections when using ADO.NET in C#?","acceptedAnswer":{"@type":"Answer","text":"Use parameterized queries and wrap database objects in using blocks. Parameters are added with cmd.Parameters.Add using a SqlDbType, such as SqlDbType.Int for an Id or NVarChar with a length for text. The using blocks around SqlConnection, SqlCommand, SqlDataAdapter and SqlDataReader ensure resources are disposed even when an error occurs. Developers hardening data access code follow ADO.NET and SQL injection guidance on daily.dev."}}]}
```

