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 update the datas present in textbox to gridview control (gui) ,SQL2005

how to update the datas present in textbox to gridview control (gui) ,SQL2005

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

    Hi in my windows application i have two forms one contains gridview, dataset and binding source. the other form has textbox,combobox and a button. if i click the button present in second form the datas present in textbox shld be update with the combobox...the update result shld be present in grid view... i have written the code but its not working here is the code private void botton_click() { SqlConnection con=new SqlConection)("severname=dot ;database=data;uid=123;pass=sdf;") SqlCommand cmd=new SqlCommand("update tablename set Textbox='"+textBox1.Text+"' where Combo='"+ComboBox1.SelectedItem+"',con") cmd.ExecuteNonQurey(); con.Close } the above code is running but its not updating the gridview Please give me some ideas thanking you

    N 1 Reply Last reply
    0
    • M Mads115

      Hi in my windows application i have two forms one contains gridview, dataset and binding source. the other form has textbox,combobox and a button. if i click the button present in second form the datas present in textbox shld be update with the combobox...the update result shld be present in grid view... i have written the code but its not working here is the code private void botton_click() { SqlConnection con=new SqlConection)("severname=dot ;database=data;uid=123;pass=sdf;") SqlCommand cmd=new SqlCommand("update tablename set Textbox='"+textBox1.Text+"' where Combo='"+ComboBox1.SelectedItem+"',con") cmd.ExecuteNonQurey(); con.Close } the above code is running but its not updating the gridview Please give me some ideas thanking you

      N Offline
      N Offline
      Noctris
      wrote on last edited by
      #2

      Your gridview does not know of the update as long as you don't tell it you have done an update. You should requery your database for the new data

      Do Or Don't, there is no "try catch ex as exception end try"

      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