title: How to display data based on current logged user?
body: <p>How do you display data that is retrieved from database according to the current login user? I know that I should declare the id, but I don't really know how...</p>
  <p>I have 2 tables in SQL.</p>
  <p>User:</p>
  <p>ID || Name || Last_Name || date ||</p>
  <p>List</p>
  <p>ID || Product || description || user_id</p>
  <pre><code>private void BindGridView()
      {  
  string constr = ConfigurationManager.ConnectionStrings[&quot;strConn&quot;].ConnectionString;
  
              using (SqlConnection conn = new SqlConnection(constr))
              {
  
                  using (SqlCommand cmd = new SqlCommand())
                  { 
                      cmd.Connection = conn;
                      cmd.CommandText = @&quot;SELECT * From List where ID = @ID&quot;;
                      cmd.Parameters.AddWithValue(&quot;@ID&quot;, ?);
  
                      using (SqlDataAdapter ad = new SqlDataAdapter(cmd))
                      {
                          DataTable dt = new DataTable();
                          ad.Fill(dt);
                          GridView1.DataSource = dt;
                          GridView1.DataBind();
                      }
                  }     
          }
      }
  </code></pre>