Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help with this windows form application in C# using VS . The image depicts the application I need help with. I am able to
Need help with this windows form application in C# using VS The image depicts the application I need help with. I am able to get the names to show but I also need a DataRow and get the Course Title for the other text box; and also need a query from the student table and use the course id from the text box to find students with that course Id Then have them added to the list box. I am stuck and left off here. using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CourseProject
public partial class WhoIsInCourse : Form
public WhoIsInCourse
InitializeComponent;
using SqlConnection conn newPropertiesSettings.Default.connString;
using SqlDataAdapter adapter newSELECT FROM student", conn;
DataTable advisorTable new;
adapter.FilladvisorTable;
studentListBox.DisplayMember "studentName";
studentListBox.ValueMember "studentId";
studentListBox.DataSource advisorTable;
Close form
private void closeButtonClickobject sender EventArgs e
this.Close;
private void findButtonClickobject sender EventArgs e
Todo search course database table using course ID Update course name text box and then update student
list box with all students enrolled in that course
using SqlConnection conn newPropertiesSettings.Default.connString;
using SqlDataAdapter adapter newSELECT FROM courses WHERE courseId @courseId", conn;
adapter.SelectCommand.Parameters.AddWithValue@courseId", courseIdTextBox.Text;
DataTable courseIdTable new;
adapter.FillcourseIdTable;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started