谁能帮我看下这段代码。。=w=不知道问题出在哪里
我前台有一个repeater控件,可是不知道为什么绑定后的数据会出现问题,数据都显示的相同一条,但我把sql语句放到数据库里面查的数据缺失不同的
我dal层这么写的
public static DataTable GetOvertimeSheet(int utype, int uid, int did)
{
object a = utype;
List<tb_OvertimeSheetTable> list = new List<tb_OvertimeSheetTable>();
using (SqlConnection con = new SqlConnection(DBhelper.connectionString))
{
DataSet ds = new DataSet();
string sql="select B.ID ,EmployeeID,B.SerialNumber,ExpectStartTime,ExpectEndTime,StartTime,EndTime,LeaveType,LeaveReason,ApproveStatus,ApplyLevel,LeaveStatus,B.UserID,LastUpdateTime,CreateTime,IsDel, T.Name,T.SerialNumber,T.PositionID,T.DepartmentID,T.UserID,T1.G_CName as DepartmentNa,T1.GroupID,T2.GroupID,T2.G_CName as Position,T3.U_Type from tb_OvertimeSheet as B INNER JOIN tb_EmployeesInfo as T On B.UserID = T.UserID INNER JOIN sys_Group as T1 On T.DepartmentID = T1.GroupID INNER Join sys_Group as T2 on T.PositionID =T2.GroupID INNER Join sys_User as T3 on B.UserID =T3.UserID where LeaveStatus = 0 and T3.U_Type between @Utype and @tys and b.UserID = @uid and T.DepartmentID = @did order by B.CreateTime DESC";
SqlCommand cmd = new SqlCommand(sql.ToString(), con);
con.Open();
cmd.Parameters.Add("@Utype", SqlDbType.TinyInt).Value = utype - 1;
cmd.Parameters.Add("@tys", SqlDbType.TinyInt).Value = utype;
cmd.Parameters.Add("@uid", SqlDbType.Int).Value = uid;
cmd.Parameters.Add("@did", SqlDbType.Int).Value = did;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(ds);
return ds.Tables[0];
}
}
public static List<tb_OvertimeSheetTable> getLists(int utype,