public static List<SmsBindTemp> TosmsBindTempObject(DataSet ds) { List<SmsBindTemp> smsList = new List<SmsBindTemp>(); if (ds.Tables.Count > 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { SmsBindTemp obj = new SmsBindTemp(); obj.setSn(dr["sn"].ToString()); obj.setUuid(dr["uuid"].ToString()); obj.setName(dr["name"].ToString()); obj.setUserId(dr["userid"].ToString()); obj.setUserMessageId(dr["usermessageid"].ToString()); obj.setPhone(dr["phone"].ToString()); obj.setAddress(dr["address"].ToString()); obj.setIdNumber(dr["idnumber"].ToString()); obj.setHostName(dr["hostname"].ToString()); obj.setReceiveFlag(int.Parse(dr["receiveflag"].ToString())); obj.setCounter(int.Parse(dr["counter"].ToString())); obj.setCreateTime(DateTime.Parse(dr["createtime"].ToString())); obj.setId(long.Parse(dr["id"].ToString())); smsList.Add(obj); } } return smsList; }