分割字符串

if (libUser.Items.Count > 0)
{
string _sUserList = string.Empty;
foreach (object o in libUser.Items)
{
_sUserList += o.ToString().Split('|').GetValue(1).ToString() + ",";
}
_sUserList = _sUserList.TrimEnd(',');
dgvEmployees.DataSource = oWork.GetDataByEmployeeID(_sUserList).Tables[0];
}
else
{
dgvEmployees.DataSource = oWork.GetDataByEmployeeID(string.Empty).Tables[0];

}

 

posted @ 2013-11-07 11:11  Mark1997  阅读(146)  评论(0编辑  收藏  举报