M
Mike P
I am trying to edit a checkbox value in a datagrid. However, whether
the user checks the box or not, the field is updated as 'False'. My code
is :
<asp:TemplateColumn headertext="dnxlate">
<itemtemplate>
<%#
DataBinder.Eval(Container.DataItem, "DNXLate") %>
</itemtemplate>
<edititemtemplate>
<asp:CheckBox
id="chkDNXLate" runat="server" />
</edititemtemplate>
</asp:templatecolumn>
Update event:
string strDNXLate = ((CheckBox)e.Item.FindControl("chkDNXLate")).Text;
string strCallLogUpdate = "UPDATE CallType SET RSValue = " + strRSValue
+ ", DNXLate = '" + strDNXLate + "', DCUG = " + strDCUG + ", CallType =
" + strCallType + " WHERE Diallednum = '" + strDialledNum + "'";
I think the problem must be where I am converting the value to a string
to put in the database, but I can't figure out how to fix it. Can
anybody help me out?
Thanks,
Mike
the user checks the box or not, the field is updated as 'False'. My code
is :
<asp:TemplateColumn headertext="dnxlate">
<itemtemplate>
<%#
DataBinder.Eval(Container.DataItem, "DNXLate") %>
</itemtemplate>
<edititemtemplate>
<asp:CheckBox
id="chkDNXLate" runat="server" />
</edititemtemplate>
</asp:templatecolumn>
Update event:
string strDNXLate = ((CheckBox)e.Item.FindControl("chkDNXLate")).Text;
string strCallLogUpdate = "UPDATE CallType SET RSValue = " + strRSValue
+ ", DNXLate = '" + strDNXLate + "', DCUG = " + strDCUG + ", CallType =
" + strCallType + " WHERE Diallednum = '" + strDialledNum + "'";
I think the problem must be where I am converting the value to a string
to put in the database, but I can't figure out how to fix it. Can
anybody help me out?
Thanks,
Mike