Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gridview update table without identity field

Status
Not open for further replies.

vcllvc

Programmer
Jul 12, 2001
136
US
I have a table which does not have an identity field.

When I need to update a row, I will pass in both old values and new values in the query to make sure I am updating the correct row.

If I have a gridview bind to the table, is there a way to update a row? Or I must add an identity field to get it work.

Thanks in advance.
 
I don't know if I understand correct, but I think you can accomplish what you want with a WHERE clause on the update statement since you are also passing the old values.

UPDATE blah blah blah WHERE sqlField=oldValue AND sqlField2=oldValue2

sqlField and sqlField2 are the columns in the database and oldValue and oldValue2 are the old values you are passing.
don't know if that's what you're looking for but HTH.
 
you don't need an identity per se, but you should have a key column(s) on the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top