我有一个类似的 SQL 输出
TotalLeave Status
---------- ------
3 PaidLeave
5 MedicalLave
我需要在我的标签控件中显示这个值,比如,
lblMedicalLeave.text = 5
lblPaidLeave.text = 3
为此,我刚刚在我的代码中为我的数据集创建了对象,例如,
StaffAttendanceStatusTableAdapters.StaffTypesTableAdapter staffAttendanceStatus =
new StaffAttendanceStatusTableAdapters.StaffTypesTableAdapter();
StaffAttendanceStatus.StaffTypesDataTable StaffDataTable =
staffAttendanceStatus.GetDataStaffAttendanceStatus(staff.StaffId);
if (StaffDataTable[0] != null)
{
StaffAttendanceStatus.StaffTypesRow StaffRow = StaffDataTable[0];
lblTotalMedicalLeave.Text = StaffRow.TotalLeave.ToString();
lblTotalPaidLeave.Text = StaffRow.TotalLeave.ToString();
}
它显示相同的值(3),是否可以获得相应状态的 TotalLeave 值?有人能帮我一下吗