Click here to Skip to main content
14,267,320 members
Rate this:
Please Sign up or sign in to vote.
I have 2 dropdown boxes,1 textbox and a checkbox list with 4 checklist items on my page.I have taken the checkbox list datatype as bit in sql.If there exists any data in DB,all the details would be displayed on the page.There is also a link button from where user can add the data into DB.Now when user enters the values and selects 1 or more check boxes on the webpage, all the selected details have to be stored in database.Im using MVC .pls help
Posted
Comments
Tejas Vaishnav 19-Aug-11 4:21am
   
Can you describe your question in detail for better understanding "what you want"

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi,
dtbl = SPEmployee.Details(DateTime.Today);

for (int i = 0; i < cbxEmployeeAll.Items.Count; i++)
{
if (cbxEmployeeAll.Items[i].Selected == true)
{
infoPerformanceJudge.JudgeId = SPPerformanceJudge.PerformanceJudgeGetMax();
infoPerformanceJudge.Empcode = cbxEmployeeAll.Items[i].Value;
infoPerformanceJudge.Description = "";
infoPerformanceJudge.Status = true;
infoPerformanceJudge.Extra2 = "";
SPPerformanceJudge.PerformanceJudgeAdd(infoPerformanceJudge);
lblMessage.Visible = true;
lblMessage.ForeColor = Color.Green;
lblMessage.Text = "Saved successfully";
}
}


For View details,
foreach (DataRow drow in dtbl.Rows)
{
foreach (ListItem lstitem in cbxEmployeeAll.Items)
{
if (lstitem.Value == drow.ItemArray[1].ToString())
{
lstitem.Selected = true;
}
}
}
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100