A CRUD application is a type of software that allows users to create, read, update, and delete data in a database. CRUD applications are used in a variety of industries and are essential for managing large amounts of data.
In this article, we'll be building a simple CRUD application in C# using Windows Forms. We'll be using Visual Studio, which is a popular integrated development environment (IDE) for Windows applications.
To get started, open Visual Studio and create a new Windows Forms project. To do this, go to File > New > Project.
In the New Project dialog, Select Visual C# templates > Choose .Net Framework > Select "Windows Forms App (.Net Framework)". Give your project a name and choose a location to save it. Then click "Create".
Once the application is created successfully, We will start adding controls from the Toolbox section as shown below and provide proper naming for controls.
Next, We will create a database and table in SQL Server. Open "Microsoft SQL Server Management Studio" > Right Click "Database" folder > Click "New Database".
In the below "New Database" dialog, provide a new database name as "dbEmployeeDetails" and click OK.
Run the below new table creation query in the SQL window to create a new
CREATE TABLE [dbo].[Emp_details]( [EmpId] [int] NOT NULL, [EmpName] [nvarchar](50) NULL, [EmpAge] [int] NULL, [EmpContact] [int] NULL, [EmpGender] [nchar](10) NULL )
You can also verify table columns by Right Click the newly created table and clicking "Design". The table looks like below in SQL studio,
Next article, We will see how to create a database connection from a Windows application to a database and CRUD Operation (Create, Retrieve, Update, and Delete).