DataGridView row id?

munnaluru

New member
Joined
Nov 2, 2008
Messages
4
Programming Experience
Beginner
Hi
I am using sqlserver 2005 as my database.

I have a datagridview in which i have displayed three columns of data from database as id, firstname,lastname and in the fourth column of datagridview i have a button.When i click the button i will get a new form where i edit those details.

My problem is how can i get the value of the id of the row of the button i have clicked.

If i get the id of that particular record(row in the datagridview) i want to edit i can update it in the database.

So please can anybody give me the code snippet for getting the id value of that particular row whose button i have clicked.
 
good way ,
create a same binding in Form2 and this time in form View.. then remove the fill command from form_load event...then
when the previous form button was clicked.. set a event
and in that...

------button click evt
Form2.databindingSource=PreviousForm.DatabindingSource
Form2.databindingSource.Position=PreviousForm.DatabindingSource
'you can also get ids from upper command
 
Back
Top