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. Insert multiple rows into Database

Insert multiple rows into Database

Scheduled Pinned Locked Moved C#
databasesaleshelp
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
    soneliso
    wrote on last edited by
    #1

    Please help i have a customer id in textbox, a listview listing 2 to 3 items. So what i want is to insert this into a database with out the id on the textbox changing. Which means i want to add 3 rows at the same time, without changing the id in the textbox. ID on TextBox = 1 Sample on ListView Name Descr Amount Mouse Black 20 Keyboard Black 30 USB 256MB 200 This is what i want the output to be like sample on Database 1 Mouse Black 20 1 Keyboard Black 30 1 USB 256MB 200 Please Back of i'm coding!!!!

    M 1 Reply Last reply
    0
    • S soneliso

      Please help i have a customer id in textbox, a listview listing 2 to 3 items. So what i want is to insert this into a database with out the id on the textbox changing. Which means i want to add 3 rows at the same time, without changing the id in the textbox. ID on TextBox = 1 Sample on ListView Name Descr Amount Mouse Black 20 Keyboard Black 30 USB 256MB 200 This is what i want the output to be like sample on Database 1 Mouse Black 20 1 Keyboard Black 30 1 USB 256MB 200 Please Back of i'm coding!!!!

      M Offline
      M Offline
      mamirbalouch
      wrote on last edited by
      #2

      Suppose: Text Box = tb List Box = lb Pseudo code : for(int i=0; i

      S 1 Reply Last reply
      0
      • M mamirbalouch

        Suppose: Text Box = tb List Box = lb Pseudo code : for(int i=0; i

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

        Thanks I understand this using a listbox, but i'm using a ListView with 3 column and 2 rows. So what i want is get Cell1, cell2, and cell3 at the same time and insert them Aints never sleep at all, so why should I?

        K 1 Reply Last reply
        0
        • S soneliso

          Thanks I understand this using a listbox, but i'm using a ListView with 3 column and 2 rows. So what i want is get Cell1, cell2, and cell3 at the same time and insert them Aints never sleep at all, so why should I?

          K Offline
          K Offline
          kalyan_2416
          wrote on last edited by
          #4

          hi make dataset of ur data... and update like this dataadapter.update(dataset); i.e. da.update(ds);

          S 1 Reply Last reply
          0
          • K kalyan_2416

            hi make dataset of ur data... and update like this dataadapter.update(dataset); i.e. da.update(ds);

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

            Thanks All is all

            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