Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
