data grid view
Form1.cs using System; using System.Data; using System.Windows.Forms; namespace StudentRecordsApp { public partial class Form1 : Form { DataTable dt = new DataTable(); public Form1() { InitializeComponent(); InitializeDataTable(); } private void InitializeDataTable() { dt.Columns.Add("Student ID"); dt.Columns.Add("Name"); dt.Columns.Add("Age"); dt.Columns.Add("Course"); dataGridView1.DataSource = dt; } private void btnAdd_Click(object sender, EventArgs e) { if (txtStudentID.Text == "" || txtName.Text == "" || txtAge.Text == "" || txtCourse.Text == "") { MessageBox.Show("Please fill in all fields.", "Missing Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } dt.Rows.Add(txtStudentID.Text, txtName.Text, txtAge.Text, txtCourse.Text); txtStudentID.Clear(); txtName.Clear(); txtAge.Clear(); txtCourse.Clear(); } } } Program.cs using System; using System.Collections.Generic;...