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. Web Development
  3. ASP.NET
  4. bind Checkboxes

bind Checkboxes

Scheduled Pinned Locked Moved ASP.NET
databasequestion
4 Posts 4 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.
  • M Offline
    M Offline
    m dhu
    wrote on last edited by
    #1

    Im having around 30 Checkboxes in page i need to insert name of those checkboxes in a single column(seperated by comma) of table into db and also need to bind them from db how can i do it in simple way....

    B D K 3 Replies Last reply
    0
    • M m dhu

      Im having around 30 Checkboxes in page i need to insert name of those checkboxes in a single column(seperated by comma) of table into db and also need to bind them from db how can i do it in simple way....

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      I dont think there is simple way except making a temp collection after getting data from db and again costomise the names according to your requirement.

      Cheers!! Brij

      1 Reply Last reply
      0
      • M m dhu

        Im having around 30 Checkboxes in page i need to insert name of those checkboxes in a single column(seperated by comma) of table into db and also need to bind them from db how can i do it in simple way....

        D Offline
        D Offline
        Dinesh Mani
        wrote on last edited by
        #3

        I think you can use a CheckBoxList for this. Just get the items from the database, split it on "," and get a array/collection and bind it in.. BTW, why would you want to save the names of checkboxes to the db?? It should be a pre-defined list editable through the DB or other means only.

        1 Reply Last reply
        0
        • M m dhu

          Im having around 30 Checkboxes in page i need to insert name of those checkboxes in a single column(seperated by comma) of table into db and also need to bind them from db how can i do it in simple way....

          K Offline
          K Offline
          keyur satyadev
          wrote on last edited by
          #4

          in CS page split it with ',' and using for loop bind the each checkbox. now when you want to save in DB again using loop, save in one string (comma separated)(both Id and Text), pass this string to DB and using while loop split it with comman and update the text with particular Id. let me know if you have any issues.

          Regards Keyur Satyadev

          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