string [] str = deptid.Split(','); int[] wxdepid = new int[str.Count()]; for(int i=0;i<wxdepid.Count();i++) { wxdepid[i] = Convert.ToInt32(str[i]); }