Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2004, 05:45 AM
Registered User
 
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to Convert a int in a bool with FormatStrings


The Problem is:

I have a Column in my DB and it's a tinyint there's no way to chnage that!
But this tinyint is set througe a DataGrid,
so if ya create a new set of Data u check a CheckBox if it's in or not. And hat's no Problem.
But when I want to update a existing set, i want it to have all stats updatet what it is in DB, but in this problem Colum in DB is jut an int (0 or 1) but the CheckBox wants an Boolean....

any ideas how to solve that???


That's the way i already tryd it.
But The Problem here is, When it comes to DataBind Method it says It couldn't be done!

code snippet:

aspx

Code:
<EditItemTemplate>
    <asp:CheckBox ID="chkResendEdit" Checked='<# FormatBooleanFromInt((string)DataBinder.Eval(Container.DataItem, "ResendErrSMS")) %>' Text="Resend" Runat="server" />
</EditItemTemplate>
code behind

Code:
        public Boolean FormatBooleanFromInt(string svalue)
        {
            if (svalue == "0")
            {
                return false;
            }
            else
            {
                return true;
            }
        }
 
Old October 26th, 2004, 05:51 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This is the classic ASP area
Chuck this post in the .net area for a solution

Wind is your friend
Matt
 
Old October 26th, 2004, 05:53 AM
Registered User
 
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok... thx ...

this one can get closed then...

ShadowMoon





Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot implecitly convert type bool to string vaidyapragati General .NET 1 May 4th, 2007 09:10 PM
Convert from bool Ric_H MySQL 1 May 22nd, 2006 11:55 PM
cant implicitly convert type int to bool muskaanbajaj BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 19th, 2005 04:57 PM
Cannot implicitly convert type int to bool muskaanbajaj General .NET 12 May 5th, 2005 03:57 AM
Can't convert type 'bool' to 'int' Gjerstad BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 9th, 2003 10:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.