hi i need to update checkbox values to database which is in formview control depending upon wat the user selects?
i ve written the code lik dis but here its updating depending upon the first checkbox
for ex if the first checkbox is true its taking the remaining checkboxes values also as true no matter if their value is false and the same happens for viceversa?
can any1 help me regarding dis?
the code i ve written is below
[code=cpp]
CheckBox EmployeeRequest UploadedMailInt ranet = ((CheckBox)frmv iewpreference.F indControl("chk bxClientRegisMa il"));
bool EmployeeRequest UploadMailIntra net=EmployeeReq uestUploadedMai lIntranet.Check ed;
CheckBox EmployeeRequest UploadedInterne t = ((CheckBox)frmv iewpreference.F indControl("chk bxClientRegisMa il"));
bool EmployeeRequest UploadInternet= EmployeeRequest UploadedInterne t.Checked;
//Updating the preferences of the client using SqlHelper.
SqlHelper.Execu teNonQuery(tran s, CommandType.Tex t, "Update tClient set EmployeeRequest UploadedMailInt ranet='" + EmployeeRequest UploadMailIntra net + "',EmployeeRequ estUploadedInte rnet='" + EmployeeRequest UploadInternet + "' where ClientID=" + Session["clientId"]);
lblmsg.Text = "Preference s Updated";[/code]
i ve written the code lik dis but here its updating depending upon the first checkbox
for ex if the first checkbox is true its taking the remaining checkboxes values also as true no matter if their value is false and the same happens for viceversa?
can any1 help me regarding dis?
the code i ve written is below
[code=cpp]
CheckBox EmployeeRequest UploadedMailInt ranet = ((CheckBox)frmv iewpreference.F indControl("chk bxClientRegisMa il"));
bool EmployeeRequest UploadMailIntra net=EmployeeReq uestUploadedMai lIntranet.Check ed;
CheckBox EmployeeRequest UploadedInterne t = ((CheckBox)frmv iewpreference.F indControl("chk bxClientRegisMa il"));
bool EmployeeRequest UploadInternet= EmployeeRequest UploadedInterne t.Checked;
//Updating the preferences of the client using SqlHelper.
SqlHelper.Execu teNonQuery(tran s, CommandType.Tex t, "Update tClient set EmployeeRequest UploadedMailInt ranet='" + EmployeeRequest UploadMailIntra net + "',EmployeeRequ estUploadedInte rnet='" + EmployeeRequest UploadInternet + "' where ClientID=" + Session["clientId"]);
lblmsg.Text = "Preference s Updated";[/code]
Comment