Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

SQL Update statement in dataGridView

gridview grid datagridview

  • Please log in to reply
2 replies to this topic

#1 Tonchi

Tonchi

    Helping the world with programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1249 posts
  • Location:Zagreb
  • Programming Language:C#, Others
  • Learning:C, C++, Python, JavaScript, Transact-SQL, Assembly

Posted 22 August 2011 - 01:01 PM

can someone give me an example for using Update statement...I have one dataGridView control with one column and x rows...after I click Update button than I want to update that table into my database
how should my query looks like if it is non static?
  • 0

#2 gregwarner

gregwarner

    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1586 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 23 August 2011 - 07:20 AM

UPDATE `tbl_name` SET `col_name`=[I](some value)[/I] [ , `another_col_name`=[I](some value)[/I] ] WHERE `id_col_name`=(some id value);

That what you're looking for?

Here's the full UPDATE syntax documentation:
MySQL :: MySQL 5.0 Reference Manual :: 12.2.10 UPDATE Syntax
  • 0

ti-99-sig.png
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#3 Tonchi

Tonchi

    Helping the world with programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1249 posts
  • Location:Zagreb
  • Programming Language:C#, Others
  • Learning:C, C++, Python, JavaScript, Transact-SQL, Assembly

Posted 23 August 2011 - 03:04 PM

i know the syntax but what i'm trying to do here is not that...i don't know how to explain so i will give you my project here and then you will know what i need
[ATTACH]4187[/ATTACH]
now open the solution file and debbug that project and when you will be in program click on update button and you will see my problem

Attached Files


  • 0





Also tagged with one or more of these keywords: gridview, grid, datagridview

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download