title: Displaying Selected values(Sql query) using c# and html
body: <p>I want to display the data that is selected in the SQL query , I tried to use <code>ExecuteScalar()</code> but it only work with 1 value , here is my c# code :</p>
  
  <pre><code>SqlConnection conn = new SqlConnection("Data Source=MAX-PC\\SQLEXPRESS;Initial Catalog=newSchool;Integrated Security=True");
          SqlCommand cmd = new SqlCommand("view_profile", conn);
          cmd.CommandText = "exec view_profile @posted_id";
          cmd.Parameters.AddWithValue("@posted_id", WebForm1.x);
          conn.Open();
          cmd.ExecuteNonQuery;
          conn.Close();
  </code></pre>
  
  <p>and that's the proc : </p>
  
  <pre><code>CREATE PROC view_profile
  
  @posted_in INTEGER
  AS
  BEGIN
  SELECT P.poster , P.post_description
  FROM Posts P
  WHERE P.posted_in = @posted_in
  END
  </code></pre>