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. update

update

Scheduled Pinned Locked Moved C#
databasehelpannouncement
3 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.
  • K Offline
    K Offline
    kjosh
    wrote on last edited by
    #1

    Hi, In my form one datagridview control is there,insert button When we click on insert a new row is added to the datagidview.If we enter values in that new row and click on save button ,the newly inserted row is updated to database.To get this what code i have to write in save button click. Please help me. Thanks in advance

    M 1 Reply Last reply
    0
    • K kjosh

      Hi, In my form one datagridview control is there,insert button When we click on insert a new row is added to the datagidview.If we enter values in that new row and click on save button ,the newly inserted row is updated to database.To get this what code i have to write in save button click. Please help me. Thanks in advance

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

      first you must set the gridview DataSource: dataGridView1.DataSource =DS.tables["x"]; then u must add row to the DataTable for exmaple : a = a+1; b = textBox1.Text; dt.Rows.Add(new object[] { a, b}); after click the button to update data in database: scb = new SqlCommandBuilder(DA); DA.Update(DS, "tbhazine");

      K 1 Reply Last reply
      0
      • M maryamf

        first you must set the gridview DataSource: dataGridView1.DataSource =DS.tables["x"]; then u must add row to the DataTable for exmaple : a = a+1; b = textBox1.Text; dt.Rows.Add(new object[] { a, b}); after click the button to update data in database: scb = new SqlCommandBuilder(DA); DA.Update(DS, "tbhazine");

        K Offline
        K Offline
        kjosh
        wrote on last edited by
        #3

        Hi, Thank you very much for your response.

        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