Project With Coding — Vb.net

Private Sub ClearFields() txtStudentID.Clear() txtName.Clear() numAge.Value = 18 txtCourse.Clear() txtName.Focus() End Sub

Using conn As SqlConnection = GetConnection() Using cmd As New SqlCommand(query, conn) cmd.Parameters.AddWithValue("@StudentID", Convert.ToInt32(txtStudentID.Text)) cmd.Parameters.AddWithValue("@Name", txtName.Text.Trim()) cmd.Parameters.AddWithValue("@Age", numAge.Value) cmd.Parameters.AddWithValue("@Course", txtCourse.Text.Trim()) Vb.net Project With Coding

| Control Type | Name | Text / Purpose | |--------------|------|----------------| | Label | - | "Student Management System" (Font: bold) | | Label | - | "Student ID" | | TextBox | txtStudentID | (ReadOnly for auto-generated ID) | | Label | - | "Name" | | TextBox | txtName | | | Label | - | "Age" | | NumericUpDown | numAge | Minimum=1, Maximum=100 | | Label | - | "Course" | | TextBox | txtCourse | | | Button | btnAdd | Add Student | | Button | btnUpdate | Update | | Button | btnDelete | Delete | | Button | btnClear | Clear Fields | | TextBox | txtSearch | Search box | | Button | btnSearch | Search | | DataGridView | dgvStudents | (Dock: Bottom, Anchor: Top,Bottom,Left,Right) | Create a new module DatabaseHelper.vb : Private Sub ClearFields() txtStudentID

dgvStudents.DataSource = dataTable

Happy coding! 🚀

Using conn As SqlConnection = GetConnection() Using cmd As New SqlCommand(query, conn) cmd.Parameters.AddWithValue("@Name", txtName.Text.Trim()) cmd.Parameters.AddWithValue("@Age", numAge.Value) cmd.Parameters.AddWithValue("@Course", txtCourse.Text.Trim()) Vb.net Project With Coding