我尝试了以下代码,但列仍然继承表的字段名称
DataGridView1.DataSource = ds.Tables("student_attendance_table")
With DataGridView1
.RowHeadersVisible = False
.Columns(0).Name = "Register No."
.Columns(1).Name = "Date"
.Columns(2).Name = "Year"
.Columns(3).Name = "Batch"
.Columns(4).Name = "Hour 1"
.Columns(5).Name = "Hour 2"
.Columns(6).Name = "Hour 3"
.Columns(7).Name = "Hour 4"
.Columns(8).Name = "Hour 2"
.Columns(9).Name = "Attendance"
End With
内容如下:
1138M0345 27-07-2013 3 1 P P P P P P
1138M0346 27-07-2013 3 1 P P P P P P
1138M0347 27-07-2013 3 1 P P P P P P
1138M0348 27-07-2013 3 1 P P P P P P
1138M0349 27-07-2013 3 1 P P P P P P
1138M0350 27-07-2013 3 1 P P P P P P
1138M0343 27-07-2013 3 1 A A A A A A
1138M0344 27-07-2013 3 1 A A A A A A
我还需要使用 REGNO(第一列)按升序对内容进行排序
我正在使用 vb.net