Question: Write a method to get all courses from database. using System.Data; using System.Configuration; using System.Data.SqlClient; protected void Page_Load(object sender, EventArgs e) { gvCourses.DataSource = GetCourses();
Write a method to get all courses from database.
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
protected void Page_Load(object sender, EventArgs e)
{
gvCourses.DataSource = GetCourses();
gvCourses.DataBind();
}
private DataTable GetCourses()
{
.....................
.....................
.....................
return dtCourse;
}

Output: Course Name Location CSE5041 Database Design and Development AK3B0810 MCB1007 Intr. to Probability and Statistics AK01 CSE5001 Web Programming AK5C0810 CSE5031 Operating Systems AK2B16 CSE7093 Engineering Economics AK4B0810 CSE0463 Software Quality & Testing AK4C0406
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
