Hi,
Please write code like below.
string str = "";
foreach(ListItem lstIetm In MyListBox.Items)
{
If(lstIetm.Selected)
{
str+=lstItem.Value.ToString()+",";
}
}
if(str!="")
{
str.Remove(str.LastIndexOf(','));
}
Select * from <tableName> where Id in (str)
if you are not able to solve the problem. Please copy here your code snippet.