int i;
labelNam[0].Location = new Point(119, 189);//设置课程名label控件数组的初始label的位置
for (i = 0; i < 25; i++) //设置课程名label控件数组的大小和字体
{
labelNam[i].Size = new Size(86, 19);
labelNam[i].Font = new Font("黑体", 14);
}
labelAdr[0].Location = new Point(119, 208); //设置上课地点label控件数组的初始label的位置
for (i = 0; i < 25; i++) //设置上课地点label控件数组的大小和字体
{
labelAdr[i].Size = new Size(86, 19);
labelAdr[i].Font = new Font("黑体", 14);
}
labelTeac[0].Location = new Point(119, 227); //设置任课老师label控件数组的初始label的位置
for (i = 0; i < 25; i++) //设置上课地点label控件数组的大小和字体
{
labelTeac[i].Size = new Size(86, 19);
labelTeac[i].Font = new Font("黑体", 14);
}
String st = @"Data Source=(localdb)\Projects;Initial Catalog=stumane";
SqlConnection conn = new SqlConnection(st);
conn.Open();
Form1 F = new Form1();
String sqlstr = "select * from xuexiguanlian where 学号 like '%" + F.textBox1.Text + "'and 学期=2009-2010学年第一学期'" + "%'";
SqlCommand com = new SqlCommand(sqlstr, conn);
SqlDataReader sdr = com.ExecuteReader();
3.2.3 课程信息查询
课程名选择界面如图3.2.6所示