user3080562
user3080562

Reputation: 103

C# DataGrid updating All Rows

When a user clicks on the datagrid, all information loads into a textbox but when the user changes information and clicks Update, it updates all rows instead of the single row.

This is what I'm using:

string Query = "UPDATE database.taxi SET PickupLocation='" + 
 txtPickupLocation.Text +  "',PickupArea='" + comboBxPickupArea.Text +
 "' WHERE ID = ID ;";

Upvotes: 0

Views: 68

Answers (1)

Mihai
Mihai

Reputation: 26784

WHERE ID = ID 

This condition is wrong,use WHERE ID = somenumber.ID will always be ID

Upvotes: 1

Related Questions