Converting Boolean into Bit

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Converting Boolean into Bit

    Hi

    Can anybody help to to transfer a value from Controlbox (boolean) into an
    SQL-Server (saved as bit). How am I able to convert boolean to bit. Any help
    is well appreciated.

    Thanks Peter


    peteyjr Guest

  2. Similar Questions and Discussions

    1. boolean cfsqltype
      Can someone please advise what cfsqltype should I used for boolean (true/false)? I've tried cf_sql_bit, but my results were inconsistent. i.e. ...
    2. Boolean Searches
      I am trying to implement a boolean type search . The current search that I have searches for exact matches, if the input has multiple words. I want...
    3. Converting SQL Server "bit" field to a CLR boolean-- has to be a better way
      I'm using the DataBinder.Eval() method to output the value of a SQL Server bit field. In order to convert this value to a boolean I go through the...
    4. Boolean constructor...
      Hello, When I instanciate a boolean with a string for an argument, and the display the variable for example var b:Boolean = new Boolean("ASDF");...
    5. boolean operation
      hi all, what is oposite of if ($_periode == NULL || $_periode == "") it is not if ($_periode != NULL || $_periode != "") kind regards
  3. #2

    Default Re: Converting Boolean into Bit

    Function CBit(BooleanVar)
    CBit = Abs(CInt(BooleanVar))
    End Function

    Ray at work


    "peteyjr" <peteyjr@web.de> wrote in message
    news:bvb90h$4mp$1@news.BelWue.DE...
    > Hi
    >
    > Can anybody help to to transfer a value from Controlbox (boolean) into an
    > SQL-Server (saved as bit). How am I able to convert boolean to bit. Any
    help
    > is well appreciated.
    >
    > Thanks Peter
    >
    >

    Ray at Guest

  4. #3

    Default Re: Converting Boolean into Bit

    Cant change boolean into integer without getting a error msg


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> schrieb im
    Newsbeitrag news:OGvt21n5DHA.1664@TK2MSFTNGP11.phx.gbl...
    > Function CBit(BooleanVar)
    > CBit = Abs(CInt(BooleanVar))
    > End Function
    >
    > Ray at work
    >
    >
    > "peteyjr" <peteyjr@web.de> wrote in message
    > news:bvb90h$4mp$1@news.BelWue.DE...
    > > Hi
    > >
    > > Can anybody help to to transfer a value from Controlbox (boolean) into
    an
    > > SQL-Server (saved as bit). How am I able to convert boolean to bit. Any
    > help
    > > is well appreciated.
    > >
    > > Thanks Peter
    > >
    > >
    >
    >

    peteyjr Guest

  5. #4

    Default Re: Converting Boolean into Bit

    Can you show an example and indicate what the error message is?

    Ray at work

    "peteyjr" <peteyjr@web.de> wrote in message
    news:bvbb04$6us$1@news.BelWue.DE...
    > Cant change boolean into integer without getting a error msg
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> schrieb im
    > Newsbeitrag news:OGvt21n5DHA.1664@TK2MSFTNGP11.phx.gbl...
    > > Function CBit(BooleanVar)
    > > CBit = Abs(CInt(BooleanVar))
    > > End Function
    > >
    > > Ray at work
    > >
    > >
    > > "peteyjr" <peteyjr@web.de> wrote in message
    > > news:bvb90h$4mp$1@news.BelWue.DE...
    > > > Hi
    > > >
    > > > Can anybody help to to transfer a value from Controlbox (boolean) into
    > an
    > > > SQL-Server (saved as bit). How am I able to convert boolean to bit.
    Any
    > > help
    > > > is well appreciated.
    > > >
    > > > Thanks Peter
    > > >
    > > >
    > >
    > >
    >
    >

    Ray at Guest

  6. #5

    Default Re: Converting Boolean into Bit

    peteyjr wrote:
    > Cant change boolean into integer without getting a error msg
    Yes you can. This line of code does not generate an error:

    Response.Write cint(true)

    I think the issue is that you are not dealing with a boolean value. Convert
    the value explicitly using CBool before using CInt. If the CBool function
    raises an error, then you need to figure out what the value actually is,
    using response.write.

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  7. #6

    Default Re: Converting Boolean into Bit

    peteyjr wrote on 29 jan 2004 in microsoft.public.inetserver.asp.db:
    > Cant change boolean into integer without getting a error msg
    if boolean then result=1 else result=0



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139