title: string TLDID = gvTLDs.SelectedRow.Cells[0].Text; always returns 0 in database
body: <pre><code>string TLDID = gvTLDs.SelectedRow.Cells[0].Text;
  </code></pre>
  
  <p>The code above is always returning 0 in the database. Below is how i am connecting it to the database</p>
  
  <pre><code>SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["FatshostsA2ConnectionString"].ConnectionString);
          conn.Open();
          SqlCommand com = new SqlCommand("INSERT into Interests (TLDID, UserID)" + "values(@TLDID, @UserID)", conn);
          com.Parameters.AddWithValue("@TLDID", TLDID);
          com.Parameters.AddWithValue("@UserID", Session["User"]);
          com.ExecuteNonQuery();
          conn.Close();
  </code></pre>
  
  <p>All of this is executed with the press of a button on my website. I am probably doing something wrong with the way i am calling the value of the cell from the selcted row.</p>