Link to home
Start Free TrialLog in
Avatar of 1jaws
1jawsFlag for United States of America

asked on

select parameters sqldatasource

<asp:SqlDataSource ID="dsMysource" runat="server" ConnectionString="<%$ ConnectionStrings:xxx%>"
            SelectCommand="spmy" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter Name="id" Type="Int32" DefaultValue="0" />
               <asp:Parameter Name="check" Type="Boolean" DefaultValue="0" />
            </SelectParameters>
        </asp:SqlDataSource>

I get a error for the boolean, what am I doing wrong...? I am trying to set to default value of false for the check field which is bit field...

And second part of the question on code behind c#
dsMysource.SelectParameters["check"].DefaultValue = ??? ;
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand image

Its a C# parameter field at this point, Default="False"
dsMysource.SelectParameters["check"].DefaultValue = true; // = false;
Avatar of 1jaws

ASKER

on C# code behind, I am setting to check default value to true... but on aspx , here

 <asp:Parameter Name="check" Type="Boolean" DefaultValue="0" />

trying to set to false... and for some reason giving me problem..
ASKER CERTIFIED SOLUTION
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 1jaws

ASKER

thank you and other one should be "True"