Data type when connecting to SQL 2005 Database - InfoPath Dev
in

InfoPath Dev

Data type when connecting to SQL 2005 Database

Last post 01-04-2007 09:40 PM by jthrasher. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-04-2007 06:33 PM

    Data type when connecting to SQL 2005 Database

    I'm having a bit of trouble submitting data to a SQL database and am hoping you might be able to help. I have created a SQL database that has an assortment of binary columns which I want to relate to check boxes on the form. I would like a check to insert a "1" into the database, and an uncheck to insert a "0". Now, when I create my form connected to the SQL database it changes the data type to "simpleType" and when I set "value when cleared" to "0" and "value when checked" to "1" i get the error "the default value must match the data type. Change the value or the type." Since this field came from a database, it doesn't let me change the type so I'm confused.

    Jason
  • 01-04-2007 08:43 PM In reply to

    Re: Data type when connecting to SQL 2005 Database

    Hi Jason and welcome to the forums!

    Are you seeing this error from the InfoPath Designer or when you submit? In my experience you don't need to change the checkboxes to 0/1 as long as the SQL data type is 'bit'. If you insert the value of 'true' into a bit field the database should convert that to the 0/1 that you are looking for. Have you tried just leaving everything at default?

    Also, what database server are you submitting to?
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-04-2007 09:40 PM In reply to

    Re: Data type when connecting to SQL 2005 Database

    The error is displayed when modifying the properties on the check box.

    When I add the check boxes to the form and link them to a field in the database that is already set to a binary, the data type is automatically sent to simpleType and the default values are blank. If I leave them blank, then the database show null for any submitted data whether checked or unchecked. If I try to modify the properties then it requires me to fill in the default values, which it won't let me enter 1 or 0.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.