Get the ID value in Datagridviewe C#

Asked

Viewed 93 times

-1

I have a datagridview and in this grid there is data associated with a database table, so I wanted to take only the id of the value that is in the datagridview, and play in a property of type int that receives this value. How do?

1 answer

1


I got the result using this line of code

   dataGridView1.CurrentRow.Cells[0].Value.ToString()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.