Jump to content

SQL Update statement in dataGridView

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Tonchi

Tonchi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 471 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
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?

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas

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

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 471 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users