Sabari M Sabari M
Updated date Jan 10, 2023
In this article, We will learn how to create a simple windows application using C# and will create a windows form and controls, database, and tables.

A Windows application is a standalone application that runs on desktop computers and has a collection of controls such as buttons, labels, text boxes, checkboxes, grids, radio buttons, and more.

Below example, I will show how to create a windows application and add controls to the form and create a database and tables.

Step 1:

Open Visual Studio > File > New > Click Project.

Step 2:

In New Project dialog, Select Visual C# templates > Choose .Net Framwork > Select "Windown Forms App (.Net Framework)"

Step 3:

Once the application created successfully, We will start adding controls from the Toolbox section as shown below and provide proper naming for controls.

Step 4:

Next, We will create a database and table in SQL Server. Open "Microsoft SQL Server Management Studio" > Right Click "Database" folder > Click "New Database".

The below "New Database" dialog, provide a new database name as "dbEmployeeDetails" and click OK.

Step 5:

Run below new table creation query in SQL window to create a new Emp_details table.

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 newly created table and click "Design". The table looks like below in SQL studio,

Next article, We will see how to create a database connection from windows application to database and CRUD Operation (Create, Retrieve, Update, and Delete).

CRUD Operations In Windows Application Using C# - Part 2


Sabari M
Sabari M
Software Professional, India

IT professional with 15+ years of experience in Microsoft Technologies with a strong base in Microsoft .NET (C#.Net, ASP.Net MVC, ASP.NET WEB API, Webservices,...Read More

Comments (0)

There are no comments. Be the first to comment!!!