Results 1 to 2 of 2

Thread: using the check box as a bound control

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304

    using the check box as a bound control

    can anyone help me, I have created a databinding for my check box see below:

    CheckBox1.DataBindings.Add(New Binding("Checked", ds2, "Orders.Proforma"))



    the only problem is that I can't seem to set the field type via the data designer to boolean - it simply isn't in the list of available data types, in spite if the fact that the documentation confirms that it is. Does anyone know how you create a boolean data type via the data designer (or any other way would do actually), it's just I get a casting error (cannot cast from DbNull type) whenever I try to bind and it's a new row, which is what this is.

    I tried setting the data type as tinyint, smallint and bit none of which worked (of course!)

    Temporarily I am going to get around it by not binding this particular control and sadly using manually setting the value



  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    answered my own query, I was of course adding a new row and that was where the problem was, so now after I add the new row I just set the values in the row to default values and then it works fine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width