CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 grid stored procedure datasource default values

Print topic Send  topic

Author Message
r1xliquid

Posts: 41
Posted: 07/26/2007, 1:45 PM

I cannot tell whats happening with my grid. It appears as tho the default values i input into the dialouge box for the stored procedure (datasource) of my grid always take priority over the form values that should be passed. Has anyone experienced this?

for example i have 5 bit parameters(0/1) that are passed to the procedure. they correspond to checkboxes on my grid. No matter if the check box is checked or not it codecharge executes with '0' (default value defined in codecharge for the SP)

the checkboxes are defined as checked value = 1/ unchecked value = 0

This is in an includable page, so i dont know if that is causing a problem.

if anyone has experience problems with stored procedures with bit values and checkboxes please let me know!
View profile  Send private message
Megan

Posts: 35
Posted: 02/25/2008, 9:24 PM

Did you ever get a response on this? I'm having the exact same problem - I think. I have a checkbox that I want to pass a true/false value to a stored procedure. I've configured the procedure so that the value is a "bit", the checkbox is set for boolean, checked = 1 / unchecked = 0. It's almost like the results are backwards. When the checkbox is checked, it gives me the records where the value in the table is 0; if the box is unchecked, I get no results (which is incorrect). I execute my procedure directly on the SQL server, and it works as it should, so it's not the procedure. Something in CodeCharge is not passing the data correctly.
View profile  Send private message
Megan

Posts: 35
Posted: 02/27/2008, 5:10 PM

I finally figured this out, if anyone is interested. First off, I found out that HTML passes a NULL value when the checkbox is not selected. It doesn't matter what you have in the "Unchecked Value" on the properties of the checkbox. So, I had to add a couple of lines of code into the stored procedure to check for this.

So, here's the settings for the checkbox properties:
Data Type: Integer
Checked Value: 1
Unchecked Value: 0
Default Value: 0 (depends on what you want)

Then, my procedure looked something like this:
ALTER PROCEDURE [dbo].[ProcedureName]
@s_Checkbox int

AS
BEGIN
SET NOCOUNT ON;

--check checkbox for NULL

IF @s_Checkbox IS NULL
BEGIN
SET @s_Checkbox = 0
END

SELECT dbo.TableName.*
FROM dbo.TableName
WHERE (Field= @s_Checkbox)


View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.