4 Replies Latest reply on Aug 16, 2006 10:57 PM by kruse


      Im usin the cfgrid to show database content.
      But when it get eather 0 or 1 from a bit row in the database it shows false or true.

      Is there a way to make it show the data as it is shown in the database eg. 0 and 1???

      The problem is when adding a new row i use the existing rows as a template.
      And writing false or true instead of 0 or 1 makes the code crash.
        • 1. Re: cfgrid
          paross1 Level 2
          Which database, and what is the datatype of the column?

          • 2. Re: cfgrid
            kruse Level 1
            The database used is MS SQL 2000
            and the datatype is bit
            • 3. Re: cfgrid
              paross1 Level 2
              Within your query, just CAST() your bit field to int, and it will display its integer value in CFGRID.

              SELECT CAST(your_bit_col AS int) AS new_col_name,
              FROM your_table

              • 4. Re: cfgrid
                kruse Level 1
                Thanks, that is a good solution.

                But I did something else.
                I thought a little about it and i think that true and false sayes more than 1 and 0.

                Therefore I desided to keep that. Insted I did the following.

                When I'm about to save the data I use sp_columns to get the Type_Name from the table.
                If the Type_Name is bit I convert the true/false to 1/0