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. gridview rows stored in database

gridview rows stored in database

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
6 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.
  • J Offline
    J Offline
    jadhavShubhangi
    wrote on last edited by
    #1

    hi........... I have a gridview and button.When click on button then all gridview rows inserted into database.how to do this? please help me..... thank u.

    N S 2 Replies Last reply
    0
    • J jadhavShubhangi

      hi........... I have a gridview and button.When click on button then all gridview rows inserted into database.how to do this? please help me..... thank u.

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

      You may have a GridView but without a datasource connected to it it won't display a thing. The contents of the datasource is what you want to store in the database. Have you even looked at examples of GridView?


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

      J 1 Reply Last reply
      0
      • N Not Active

        You may have a GridView but without a datasource connected to it it won't display a thing. The contents of the datasource is what you want to store in the database. Have you even looked at examples of GridView?


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

        J Offline
        J Offline
        jadhavShubhangi
        wrote on last edited by
        #3

        thanks for reply..... I have created datatable and that field are added into gridview.

        J 1 Reply Last reply
        0
        • J jadhavShubhangi

          thanks for reply..... I have created datatable and that field are added into gridview.

          J Offline
          J Offline
          JHizzle
          wrote on last edited by
          #4

          Take your datatable, loop through it and insert each row into your database table then.

          S 1 Reply Last reply
          0
          • J JHizzle

            Take your datatable, loop through it and insert each row into your database table then.

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

            You can bind DataSet with the grid so that adapter will save all the rows on single button click. You need not require to loop for all rows in grid. Adapter will do Bulk Insert.

            1 Reply Last reply
            0
            • J jadhavShubhangi

              hi........... I have a gridview and button.When click on button then all gridview rows inserted into database.how to do this? please help me..... thank u.

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

              Got that you are a beginner, but have you read anything on how grid row values can be selected and used? Any book, tuorial? Google? In button click event, you have to traverse row by row and insert in DB. Try first.

              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