1. Add a Button in each Row for GridView
2. In the command argument of the button set the Id of the Item
3. Create a Table called Favorites where you will have 2 fields UserId and ItemId
4. On the click event of Button get the ItemId as following
protected void Button1_Click(object sender, EventArgs e)
{
string itemId = (sender as Button).CommandArgument;
//Insert to database here
}