hi all,
i have a checxboxlist in my gridview. i want the user to tick an option and the ticked option to be saved to my database. i have gone this far
-
protected void Button1_Click(object sender, EventArgs e)
-
{
-
-
Response.Redirect("Direction2.aspx");
-
foreach ( GridViewRow row in GridView1.Rows)
-
{
-
CheckBoxList checkboxlist = (CheckBoxList)row.FindControl("chklist");
-
if (checkboxlist != null )
-
{
-
foreach (ListItem litem in checkboxlist.Items)
-
{
-
if (litem.Selected)
-
{
-
// THIS IS WHERE THE PROBLEM IS!
-
}
-
}
-
}
-
}
-
}
-
What code do i use to save the selected items to my database?
when i created my table in my database i did not include a checkboxlist column. i created my table using visual studio and i dont know how to include a checkboxlist in the table.
thanks guys!