string ids= string.Empty;
foreach (User objUser in dtUser)
{
ids= ids+ obiUser.UserId.ToString() + ",";
}
if (ids.Length > 0)
{
ids= ids.Substring(0, ids.Length - 1);
}
Just devide the whole string into a substring upto the leangth -1 and place it to a string

No comments:
Post a Comment