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. How to Insert more than one row in a single click using stored procedure

How to Insert more than one row in a single click using stored procedure

Scheduled Pinned Locked Moved C#
databasecsharphelptutorialquestion
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.
  • N Offline
    N Offline
    NK7
    wrote on last edited by
    #1

    Hi I have a datatable having 10 records. I want to insert the 10 records to a table in a database using stroed procedure from my front end C#. How to do? can any one help me please? Thanks in advance kesavan

    kesavan

    S A 2 Replies Last reply
    0
    • N NK7

      Hi I have a datatable having 10 records. I want to insert the 10 records to a table in a database using stroed procedure from my front end C#. How to do? can any one help me please? Thanks in advance kesavan

      kesavan

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      Write a stored procedure to insert 1 row. Then call that stored procedure once for each of the rows you which to insert. If they have to be done together, do the whole thing inside a transaction.

      Simon

      1 Reply Last reply
      0
      • N NK7

        Hi I have a datatable having 10 records. I want to insert the 10 records to a table in a database using stroed procedure from my front end C#. How to do? can any one help me please? Thanks in advance kesavan

        kesavan

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Write the stored procedure to accept an xml parameter. Send all 10 records as xml and unpack in the stored proc to insert them.

        Bob Ashfield Consultants Ltd

        G 1 Reply Last reply
        0
        • A Ashfield

          Write the stored procedure to accept an xml parameter. Send all 10 records as xml and unpack in the stored proc to insert them.

          Bob Ashfield Consultants Ltd

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          Here you go: Multiple Ways to do Multiple Inserts[^]

          Giorgi Dalakishvili #region signature my articles #endregion

          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