I have a check box on the form and want to pass it check or not to my cfstoredproc.
I tried to use followign code I got invalid data error message, I tried to use cf_sql_bit, cf_sql_int, but I always get error message,
My stored procedure expect bit data type, but I can change what ever the check box value is for database server stored procedure.
Your help and information is great appreciated,
<cfprocparam value="form.MyCheckBox" cfsqltype="cf_sql_tinyint">
<cfprocresult name="SP1" resultset="1">
<cfinput type="checkbox" name="MyCheckBox" value="MyCheckBox" id="MyCheckBox">
I think the problem you are experiencing is related to how ColdFusion stores boolean values. They are stored as true booleans, not as integer values. So you can't pass them directly to the database as a cf_sql_bit or cf_sql_int value. I usually use a User Defined Function (UDF) to convert boolean values to bit values so they can be used in database interactions. Here is a similar UDF from CFLib.org.