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. Update Multiple Selected Item from Checkboxlist to SQL server database

Update Multiple Selected Item from Checkboxlist to SQL server database

Scheduled Pinned Locked Moved ASP.NET
databasequestionsql-serversysadminhelp
3 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.
  • A Offline
    A Offline
    AsianRogueOne
    wrote on last edited by
    #1

    Hi All, I have a checkboxlist(created from db) on form where user can selected multiple items when click on update button the form send the data to sql server database. This work fine, the problem I have when the user open the form for the same record number and want change the checkboxlist items. How do I go about doing this ? For example: first time around user selected item 1,3,7,9 and 10 Second time around user selected item 2,3,5,7,9 and 10. Any assistance is greatly apprecaited. please provide codes example. Thanks DocHoliday. my code for the inserting to the db, the field that get insert are Application_id, Item# and Module (primary Key in db). Protected Sub GetCheckedModule() Dim MyItem As ListItem mstrSelectedColumns = "" For Each MyItem In chkbModule.Items If MyItem.Selected = True Then Session("Module") = MyItem.Value Insert_SelectedModule() End If Next End Sub

    N S 2 Replies Last reply
    0
    • A AsianRogueOne

      Hi All, I have a checkboxlist(created from db) on form where user can selected multiple items when click on update button the form send the data to sql server database. This work fine, the problem I have when the user open the form for the same record number and want change the checkboxlist items. How do I go about doing this ? For example: first time around user selected item 1,3,7,9 and 10 Second time around user selected item 2,3,5,7,9 and 10. Any assistance is greatly apprecaited. please provide codes example. Thanks DocHoliday. my code for the inserting to the db, the field that get insert are Application_id, Item# and Module (primary Key in db). Protected Sub GetCheckedModule() Dim MyItem As ListItem mstrSelectedColumns = "" For Each MyItem In chkbModule.Items If MyItem.Selected = True Then Session("Module") = MyItem.Value Insert_SelectedModule() End If Next End Sub

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      One, learn to format any code snippets you post here. Bind the checklistbox to the datasource


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • A AsianRogueOne

        Hi All, I have a checkboxlist(created from db) on form where user can selected multiple items when click on update button the form send the data to sql server database. This work fine, the problem I have when the user open the form for the same record number and want change the checkboxlist items. How do I go about doing this ? For example: first time around user selected item 1,3,7,9 and 10 Second time around user selected item 2,3,5,7,9 and 10. Any assistance is greatly apprecaited. please provide codes example. Thanks DocHoliday. my code for the inserting to the db, the field that get insert are Application_id, Item# and Module (primary Key in db). Protected Sub GetCheckedModule() Dim MyItem As ListItem mstrSelectedColumns = "" For Each MyItem In chkbModule.Items If MyItem.Selected = True Then Session("Module") = MyItem.Value Insert_SelectedModule() End If Next End Sub

        S Offline
        S Offline
        Sandeep Mewara
        wrote on last edited by
        #3

        DocHoliday66 wrote:

        when the user open the form for the same record number and want change the checkboxlist items. How do I go about doing this

        You need to do the following: 1. Check the details about that 'record' number already exists or not. 2. If you find that there are items selected and saved in DB then retrieve that data using a Select query. 3. Once you have the data retrieved, go in a loop and explicitly select those items in the checkboxlist.

        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