Means on GridView cell click you want to fill that value to database. Right ?
after binding gridview successfully. Generate cell click event.
private void dataGridView1_CellClick(object sender,DataGridViewCellEventArgs e)
{
DataGridViewImageCell cell = (DataGridViewImageCell)dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
txtTextbox.text = cell.value;
}