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. insert multiple row using single form

insert multiple row using single form

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasesql-serversysadmin
6 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.
  • P Offline
    P Offline
    prateekfgiet
    wrote on last edited by
    #1

    hi i m using asp.net c# and in backend sql server 2000 i have a web form i m able to save single row in table using asp web page,i want to save multiple row on single click in a single table,i m new in asp.net pls help me thanks in advance

    C N U 3 Replies Last reply
    0
    • P prateekfgiet

      hi i m using asp.net c# and in backend sql server 2000 i have a web form i m able to save single row in table using asp web page,i want to save multiple row on single click in a single table,i m new in asp.net pls help me thanks in advance

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      prateekfgiet wrote:

      ,i m new in asp.net

      Then your task is kind of insane. Start slower. Learn how to lay out an ASP.NET project before worrying about databases. If you're new, I assume you're not doing paid work, or school work. If you were being paid, that would be immoral, basically theft. If it was for school, your tasks would be laid out more logically and you'd have spoken to your teacher. So, if you're teaching yourself, start simpler and build up to this task.

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      P 1 Reply Last reply
      0
      • C Christian Graus

        prateekfgiet wrote:

        ,i m new in asp.net

        Then your task is kind of insane. Start slower. Learn how to lay out an ASP.NET project before worrying about databases. If you're new, I assume you're not doing paid work, or school work. If you were being paid, that would be immoral, basically theft. If it was for school, your tasks would be laid out more logically and you'd have spoken to your teacher. So, if you're teaching yourself, start simpler and build up to this task.

        Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

        P Offline
        P Offline
        prateekfgiet
        wrote on last edited by
        #3

        i am in job as a fresher and i have to complete this in any condition so pls help

        C 1 Reply Last reply
        0
        • P prateekfgiet

          i am in job as a fresher and i have to complete this in any condition so pls help

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          OK, so you ARE being asked to steal from a client ? Shame on you, and the people who hired you. However, people like you are the reason that outsourcing will die over time, and in the meantime, why the only clients it attracts, are idiots.

          Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

          1 Reply Last reply
          0
          • P prateekfgiet

            hi i m using asp.net c# and in backend sql server 2000 i have a web form i m able to save single row in table using asp web page,i want to save multiple row on single click in a single table,i m new in asp.net pls help me thanks in advance

            N Offline
            N Offline
            Nishant Singh
            wrote on last edited by
            #5

            Hi Prateek, Create a XML string and use that XML string to insert values into table , (U have to do some googling to check building XML string and insert into DataBase table)

            1 Reply Last reply
            0
            • P prateekfgiet

              hi i m using asp.net c# and in backend sql server 2000 i have a web form i m able to save single row in table using asp web page,i want to save multiple row on single click in a single table,i m new in asp.net pls help me thanks in advance

              U Offline
              U Offline
              Uma J
              wrote on last edited by
              #6

              hey i have a solution!!!!!!!! Just save the values in Temporary datatable and after that run that temporary datatable in a loop and write the insert in it..... private void SaveGridDataInTempTable() { DataTable dtTemp = new DataTable(); if (dtTemp == null || dtTemp.Columns.Count <= 0) { dtTemp.Columns.Add("sino"); dtTemp.Columns.Add("name", typeof(String)); dtTemp.Columns.Add("gender", typeof(String)); dtTemp.Columns.Add("qualification", typeof(String)); dtTemp.PrimaryKey = new DataColumn[] { dtTemp.Columns["sino"] }; } foreach (GridViewRow gvRow in GridView1.Rows) { DataRow drTemp = dtTemp.NewRow(); drTemp["sino"] = int.Parse(GridView1.DataKeys[gvRow.RowIndex]["sino"].ToString()); drTemp["name"] = ((TextBox)gvRow.FindControl("TextBox1")).Text.Trim(); drTemp["gender"] = ((RadioButtonList)gvRow.FindControl("RadioButtonList1")).SelectedValue.ToString(); drTemp["qualification"] = ((DropDownList)gvRow.FindControl("DropDownList1")).SelectedValue.ToString(); dtTemp.Rows.Add(drTemp); } Temp = dtTemp; } //Property to maintain the Datatable public DataTable Temp { get { object o = ViewState["Temp"]; if (o == null) { DataTable dt = new DataTable(); return dt; } else return (DataTable)o; } set { ViewState["Temp"] = value; } } After this your normal insert code, for(int i=0;i

              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