BINDing an ASP.NET 2.0 FormView - CheckBox or RadioButton to Oracle CHAR(1) Y/N

Last post 09-09-2009 4:07 PM by mjohn87. 2 replies.

Sort Posts:

  • BINDing an ASP.NET 2.0 FormView - CheckBox or RadioButton to Oracle CHAR(1) Y/N

    04-20-2009, 12:45 PM
    • Member
      point Member
    • sb22
    • Member since 04-20-2009, 4:40 PM
    • Posts 4

    Title: BINDing an ASP.NET 2.0 FormView - CheckBox or RadioButton to Oracle CHAR(1) Y/N

    Since Oracle XE (and other versions too) does not has  BOOLEAN data type. CheckBoxes in ASP.NET are BOOLEAN controls.

    So I use  CHAR(1) column with Y or N values in the Oracle table,

    Question: how can I bind to a CheckBox or CheckBoxList or RadioButton or RadioButtonList control on an ASP.NET 2.0 web form?

     

    Filed under:
  • Re: BINDing an ASP.NET 2.0 FormView - CheckBox or RadioButton to Oracle CHAR(1) Y/N

    04-21-2009, 4:58 AM
    • Contributor
      2,607 point Contributor
    • wmec
    • Member since 12-20-2007, 6:36 AM
    • China
    • Posts 1,599

    Here is an example
    <asp:CheckBox ID="cbxStatus" runat="server" Checked='<%# Eval("status").ToString() == "0" ? true:false %>'/>

    Many Thanks & Best Regards,
    HuaMin Chen
    (If you mark it then it means the post is helpful/meaningful for other people's reference in the future!)
  • Re: BINDing an ASP.NET 2.0 FormView - CheckBox or RadioButton to Oracle CHAR(1) Y/N

    09-09-2009, 4:07 PM
    • Member
      4 point Member
    • mjohn87
    • Member since 04-06-2009, 3:38 PM
    • Posts 2

    Simple and awesome solution. I was doing all kinds of code-behind events and stuff in a freaking FormView. I found this to be the exact solution I needed. Thanks a mil

Page 1 of 1 (3 items)