コード例 #1
0
    protected void skillCardButton3_Click(object sender, EventArgs e)
    {
        UserBO obj = new UserBO();

        obj.skillName = skillCard3.Text.Trim();
        clsBLL    dt        = new clsBLL();
        DataTable dataTable = dt.CourseContentBLL(obj);

        CoursesGrid.DataSource = dataTable;
        CoursesGrid.DataBind();
    }
コード例 #2
0
        public void displayCourseData()
        {

            SqlConnection conn = new SqlConnection("Server=localhost\\SqlExpress;Database=Comp229Assign03;" + "Integrated Security=True");
            SqlCommand comm = new SqlCommand("select * from Comp229Assign03.[dbo].Courses;", conn);

            conn.Open();
            SqlDataReader reader = comm.ExecuteReader();

            while (reader.Read())
            {

                CoursesGrid.DataSource = reader;
                CoursesGrid.DataBind();
            }

            reader.Close();
            conn.Close();

        }
コード例 #3
0
 protected void LoadCourses()
 {
     CoursesGrid.DataSource = new StudentInformerWebApp.DAL.StudentInformerDbContext().Courses.ToArray();
     CoursesGrid.DataBind();
 }