日期:2014-05-17 浏览次数:20437 次
string[] groupSub = groupList.Split(',');
sql = string.Empty;
for (int i = 0; i < groupSub.Length; i++)
{
sql = "select id,user_truename from l_user where id='" + Convert.ToInt32(groupSub[i].ToString()) + "'"; //有问题
table = DbHelperSQL.Query(sql).Tables[0];
dlSelectUser.DataSource = table;
dlSelectUser.DataBind();
}
string[] groupSub = groupList.Split(',');
System.Text.StringBuilder sb = new System.Text.StringBuilder();
for (int i = 0; i < groupSub.Length; i++)
{
int n = 0;
if (int.TryParse(groupSub[i], out n))
{
sb.Append(groupSub[i] + ",");
}
}
if (sb.Length > 0)
{
sb.Remove(sb.Length - 1, 1);
sql = "select id,user_truename from l_user where id IN(" + sb.Length() + ")";
table = DbHelperSQL.Query(sql).Tables[0];
dlSelectUser.DataSource = table;
dlSelectUser.DataBind();
}