我的一个sql语句 查出4个值select student.st_name,student.st_sex,studentpic.sp_picdata,lessoncard.lc_enddate from student,studentpic,lessoncard where (lessoncard.LC_card_id='" + id + "' and lessoncard.studentid=student.id and student.st_no=studentpic.sp_studentno但是我只想用前面2个,然后把前面2个传给datagridview,这样该怎么写?
dataGridView1.DataSource = dt;
dataGridView1.Columns[2].Visible = false;
dataGridView1.Columns[3].Visible = false;
你想这列数据一值保持为当前时间?
你的用个Timer一直给这一列赋值?
DateTime date = Convert.ToDateTime("2011.10.01");
dadataGridView1.Rows[0].Cells["日期时间"].Value =date ;
dadataGridView1.Rows[0].Cells["备注"].Value = ENDdate>date ? "卡过期" : "卡未过期";
然后再添加到datagridview中