vb Code:
Dim DRow As DataRow = DS.Tables(0).Rows(0) If DS.Tables(0).Rows.Count > 0 Then .txtCourseCode.Text = DRow.Item("CourseCode").ToString() .txtRoomNumber.Text = DRow.Item("RoomNumber").ToString() .txtSchoolYear.Text = DRow.Item("SchoolYear").ToString() .txtTeacher.Text = DRow.Item("Teacher").ToString() End If
Since theirs only 1 ROW in the Table, How could I just read from that instead of having the DataRow and so on? Is their a way to reduce / optimize it? I know its not a lot, but I don't want redundant code.




Reply With Quote