Devendra  Kumar

Devendra Kumar

  • NA
  • 517
  • 244.6k

multiple checked items value insert in single column c#

Jun 17 2016 1:14 AM
how to insert multiple checked value in single column in c# 
 like i select value like this:
 
 
<asp:DropDownCheckBoxes ID="ddsize" runat="server" UseButtons="true" >
 
<asp:ListItem Text="Queen" Value="1"></asp:ListItem>
<asp:ListItem Text="Twin" Value="2"></asp:ListItem>
<asp:ListItem Text="Round" Value="3"></asp:ListItem>
<asp:ListItem Text="King" Value="4"></asp:ListItem> 
</asp:DropDownCheckBoxes>
 
 
int str =0;
for (int i = 0; i <= ddsize.Items.Count - 1; i++)
{
if (ddsize.Items[i].Selected)
{
if (str ==0)
{
str =int.Parse( ddsize.Items[i].Value);
}
else
{
str +=int.Parse(ddsize.Items[i].Value);
}
}
}
 
 
select value 1 and 2 and 3 then
 
i want insert all id in single column
 
 
 
 

Answers (7)