Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL bit to bool conversion [moved]

SQL bit to bool conversion [moved]

Scheduled Pinned Locked Moved Database
questiondatabasedata-structurestutorial
14 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

    I only read newbie introductory dummy books.

    modified on Tuesday, August 16, 2011 7:25 AM

    N D L CPalliniC S 6 Replies Last reply
    0
    • L Lost User

      What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

      I only read newbie introductory dummy books.

      modified on Tuesday, August 16, 2011 7:25 AM

      D Offline
      D Offline
      Dalek Dave
      wrote on last edited by
      #2

      5fingers wrote:

      What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value.

      Probably by asking it in the correct forum and by reading the message at the top of the page that says... Please do not post programming questions here.

      ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

      L 1 Reply Last reply
      0
      • L Lost User

        What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

        I only read newbie introductory dummy books.

        modified on Tuesday, August 16, 2011 7:25 AM

        N Offline
        N Offline
        Nagy Vilmos
        wrote on last edited by
        #3

        SELECT FORUM[^] FROM CODEPROJECT WHERE FORUM = "DATABASE"


        Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

        L 1 Reply Last reply
        0
        • L Lost User

          What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

          I only read newbie introductory dummy books.

          modified on Tuesday, August 16, 2011 7:25 AM

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See here[^]

          Every man can tell how many goats or sheep he possesses, but not how many friends.

          1 Reply Last reply
          0
          • L Lost User

            What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

            I only read newbie introductory dummy books.

            modified on Tuesday, August 16, 2011 7:25 AM

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            See here[^].

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            • L Lost User

              What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

              I only read newbie introductory dummy books.

              modified on Tuesday, August 16, 2011 7:25 AM

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              My middle one, to be exact.

              L 1 Reply Last reply
              0
              • L Lost User

                What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please

                I only read newbie introductory dummy books.

                modified on Tuesday, August 16, 2011 7:25 AM

                S Offline
                S Offline
                Smithers Jones
                wrote on last edited by
                #7

                Wow, you are long enough here on CP to know the rules, but no, you have to misbehave again and again, and then you complain why you got constantly downvoted? :thumbsdown:

                "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                L 1 Reply Last reply
                0
                • L Lost User

                  My middle one, to be exact.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  :thumbsup:

                  Unrequited desire is character building. OriginalGriff

                  L 1 Reply Last reply
                  0
                  • N Nagy Vilmos

                    SELECT FORUM[^] FROM CODEPROJECT WHERE FORUM = "DATABASE"


                    Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Your database structure is not normalized ;P ;P ;P

                    L 1 Reply Last reply
                    0
                    • S Smithers Jones

                      Wow, you are long enough here on CP to know the rules, but no, you have to misbehave again and again, and then you complain why you got constantly downvoted? :thumbsdown:

                      "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      1. create table test(name varchar(20),status bit not null) assume status has value 0 or 1. then fill to a dataset. Bind a gridview directly to dataset. Column status shows true or false on gridview which is ok. To retrieve the status value from gridviewrow.cells[1].text return empty string. Confirm.

                      I only read newbie introductory dummy books.

                      1 Reply Last reply
                      0
                      • L Lost User

                        :thumbsup:

                        Unrequited desire is character building. OriginalGriff

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        1. create table test(name varchar(20),status bit not null)

                        assume status has value 0 or 1. then fill to a dataset.

                        Bind a gridview directly to dataset.

                        Column status shows true or false on gridview which is ok.

                        To retrieve the status value from gridviewrow.cells[1].text return empty string.

                        Confirm.

                        I only read newbie introductory dummy books.

                        L 1 Reply Last reply
                        0
                        • D Dalek Dave

                          5fingers wrote:

                          What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value.

                          Probably by asking it in the correct forum and by reading the message at the top of the page that says... Please do not post programming questions here.

                          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          1. create table test(name varchar(20),status bit not null)

                          assume status has value 0 or 1. then fill to a dataset.

                          Bind a gridview directly to dataset.

                          Column status shows true or false on gridview which is ok.

                          To retrieve the status value from gridviewrow.cells[1].text return empty string.

                          Confirm.

                          I only read newbie introductory dummy books.

                          1 Reply Last reply
                          0
                          • L Lost User

                            Your database structure is not normalized ;P ;P ;P

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            1. create table test(name varchar(20),status bit not null)

                            assume status has value 0 or 1. then fill to a dataset.

                            Bind a gridview directly to dataset.

                            Column status shows true or false on gridview which is ok.

                            To retrieve the status value from gridviewrow.cells[1].text return empty string.

                            Confirm.

                            I only read newbie introductory dummy books.

                            1 Reply Last reply
                            0
                            • L Lost User

                              1. create table test(name varchar(20),status bit not null)

                              assume status has value 0 or 1. then fill to a dataset.

                              Bind a gridview directly to dataset.

                              Column status shows true or false on gridview which is ok.

                              To retrieve the status value from gridviewrow.cells[1].text return empty string.

                              Confirm.

                              I only read newbie introductory dummy books.

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              You need to spend some time with your debugger to figure out exactly where this is going wrong and why. Check all the possible values in your objects at each stage, in particular check whether gridviewrow.cells[1] actually has a text value that can be returned.

                              Unrequited desire is character building. OriginalGriff

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups