Code:
int rowIndex=gridView.CurrentRow.Index;
int Price=Convert.ToInt32(gridView.Rows[rowIndex].Cells["Price"].Value)
int Quality=Convert.ToInt32(gridView.Rows[rowIndex].Cells["Quantity"].Value);

SQLCommand insertCommand=new SqlCommand("INSERT INTO tblTable(Total) VALUES(@Total)",sqlConn);
insertCommand.Paramaters.AddWithValue("@Total",Price*Quality);

insertCommand.Conn.Open();
insertCommand.ExecuteNonReader();
insertCommand.Conn.Close();
maher, shabbir likes this