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. Saving the Values entering dynamically created Textbox into database

Saving the Values entering dynamically created Textbox into database

Scheduled Pinned Locked Moved ASP.NET
cssdatabasequestionannouncement
2 Posts 2 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.
  • M Offline
    M Offline
    Member 10625394
    wrote on last edited by
    #1

    How do I save the values entering into textbox that is dynamically created to database My Code for (int i = 0; i < Grid.Rows.Count; i++) //Grid.Rows.Count { //TextBox CC = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA"); //TextBox CC1 = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA") as TextBox; string StdMat = Grid.Rows[i].Cells[0].Text; string CA = ((TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA")).Text; string UserID = Grid.Rows[i].Cells[1].Text; Response.Write("CA= " + CC1 + "
    "); MySqlCommand cmdd = new MySqlCommand("UPDATE resultstable2 SET CA=@ca WHERE student_ID=@student_ID", conn);// coursecode=@coursecode cmdd.Parameters.AddWithValue("@ca", CA); cmdd.Parameters.AddWithValue("@coursecode", cboCourseCode.Text); cmdd.Parameters.AddWithValue("@student_ID", StdMat); cmdd.ExecuteNonQuery(); }

    D 1 Reply Last reply
    0
    • M Member 10625394

      How do I save the values entering into textbox that is dynamically created to database My Code for (int i = 0; i < Grid.Rows.Count; i++) //Grid.Rows.Count { //TextBox CC = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA"); //TextBox CC1 = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA") as TextBox; string StdMat = Grid.Rows[i].Cells[0].Text; string CA = ((TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA")).Text; string UserID = Grid.Rows[i].Cells[1].Text; Response.Write("CA= " + CC1 + "
      "); MySqlCommand cmdd = new MySqlCommand("UPDATE resultstable2 SET CA=@ca WHERE student_ID=@student_ID", conn);// coursecode=@coursecode cmdd.Parameters.AddWithValue("@ca", CA); cmdd.Parameters.AddWithValue("@coursecode", cboCourseCode.Text); cmdd.Parameters.AddWithValue("@student_ID", StdMat); cmdd.ExecuteNonQuery(); }

      D Offline
      D Offline
      deepankarbhatnagar
      wrote on last edited by
      #2

      Where do you stuck. Error comes in which line number. or What is the error

      hi

      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