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. General Programming
  3. C#
  4. Bind Binary data to Gridview

Bind Binary data to Gridview

Scheduled Pinned Locked Moved C#
questiondatabase
5 Posts 3 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.
  • S Offline
    S Offline
    SatyaKeerthi15
    wrote on last edited by
    #1

    I have Gridview with AutoGenerateColumns to true(as I don't know how many columns will come). From database I am getting binary data. When I bind data table to gridview it displays checkbox with checked and unchecked. I need to display as 0 or 1. How can I do this?

    A 1 Reply Last reply
    0
    • S SatyaKeerthi15

      I have Gridview with AutoGenerateColumns to true(as I don't know how many columns will come). From database I am getting binary data. When I bind data table to gridview it displays checkbox with checked and unchecked. I need to display as 0 or 1. How can I do this?

      A Offline
      A Offline
      Arun Jacob
      wrote on last edited by
      #2

      You can do it in multiple ways like - converting that boolean property to a string property in gridview source object, make use of template in griview.

      Arun Jacob My Technical Blog : Code.NET

      S 1 Reply Last reply
      0
      • A Arun Jacob

        You can do it in multiple ways like - converting that boolean property to a string property in gridview source object, make use of template in griview.

        Arun Jacob My Technical Blog : Code.NET

        S Offline
        S Offline
        SatyaKeerthi15
        wrote on last edited by
        #3

        Can u post sample code

        M 1 Reply Last reply
        0
        • S SatyaKeerthi15

          Can u post sample code

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Change your query to return a string or integer instead of binary using convert() in TSQL (assuming SQL Server)

          Never underestimate the power of human stupidity RAH

          S 1 Reply Last reply
          0
          • M Mycroft Holmes

            Change your query to return a string or integer instead of binary using convert() in TSQL (assuming SQL Server)

            Never underestimate the power of human stupidity RAH

            S Offline
            S Offline
            SatyaKeerthi15
            wrote on last edited by
            #5

            Thank u Holmes, working fine

            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