分割字符串
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];
}
所有问题都会有一定程度的抽象和假设