CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    Mississauga, CANADA
    Posts
    199

    Checkbox Err VB.NET, SQL2K & WEB SERVICES

    I used the walkthroughs provided by MS to create a new app, and have a problem that is not addressed in the docs.
    I created an XML Web service as in the walkthoughs to access/edit a table in SQL2000. One field in the table is type bit (boolean). When I created the windows form with the data wizard, it provided a checkbox for this field. My problem is that if the user does not click on this field when adding a new record, the error returned is <field ... does not accept null values>.
    In some uses, this checkbox should remain unchecked, rather than checked.
    To get around the error, the user must first click the checkbox and check it, then click again to uncheck it. It appears that I cannot default to false, or 0, or can I? Can anyone help?
    Paul

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    Make sure it's ThreeState property is set to false and it's CheckedState = Unchecked in the designer...

  3. #3
    Join Date
    Apr 2001
    Location
    Mississauga, CANADA
    Posts
    199
    Found a workaround. You must default the field to 0 in the XSD for the table.
    Last edited by praymond; December 18th, 2003 at 11:08 AM.
    Paul

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

Featured