全文预览

《数据库课程设计之学生信息管理系统.》

上传者:塑料瓶子 |  格式:doc  |  页数:14 |  大小:0KB

文档介绍
new SqlConnection(connectionStr); conn.Open(); SqlDataAdapter sdr1 = new SqlDataAdapter("select distinct course,student_name from STUDENTS,ENROLLS where ENROLLS.student=STUDENTS.student and sex='M'", conn); DataSet ds1 = new DataSet(); sdr1.Fill(ds1, "STUDENTS,ENROLLS"); dataGridView1.DataSource = ds1.Tables[0]; conn.Close(); } // 检索只有男生选修的课程和学生名 private void 查询 11 ToolStripMenuItem_Click(object sender, EventArgs e) { string connectionStr = "Data Source=qinjia-PC;Initial Catalog=sjk;Integrated Security=True"; SqlConnection conn = new SqlConnection(connectionStr); conn.Open(); SqlDataAdapter sdr1 = new SqlDataAdapter("select STUDENTS.student_name,COURSES.course_name,TEACHERS.teacher_name,ENROLLS.grade from COURSES,STUDENTS,TEACHERS,ENROLLS,SECTION where STUDENTS.student=ENROLLS.student and

收藏

分享

举报
下载此文档