title: How to Bind Dataset Result to ASPX page using Eval() function
body: <p>I have a code that retrieve total no of questions, answers and points from database using stored procedure. And the method returns DataSet. In ASPX page I have used Repeater and in that I have placed controls such as labels. So now how to bind the value to the labels.</p>
  
  <hr>
  
  <p>Below is the code of stored procedure</p>
  
  <pre><code>CREATE PROCEDURE Sp_GetUserStat
      @RegId int
  AS
      SELECT COUNT(*) AS question FROM tblQuestion WHERE RegID=@RegId ;
      SELECT COUNT(*)  AS answer FROM tblAnswer WHERE RegID=@RegId;
      SELECT Points FROM tblPoints WHERE RegID=@RegId ;
  RETURN 0
  </code></pre>
  
  <hr>
  
  <p>Below is the C# code</p>
  
  <pre><code>public DataSet GetUserStat(LogicLayer li)
      {
          try
          {
              cmd = new SqlCommand("Sp_GetUserStat", con);
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.Parameters.AddWithValue("@RegId", li.RegId);
              adp = new SqlDataAdapter(cmd);
              ds = new DataSet();
              adp.Fill(ds, "UserStat");
              return ds;
          }
          catch (Exception)
          {
  
              throw;
          }
          finally
          {
              cmd.Dispose();
          }
      }
  </code></pre>
  
  <hr>
  
  <p>Below is the code behind</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
           LogicLayer li = new LogicLayer();
          if (!IsPostBack)
          { 
              li.RegId = Convert.ToInt32(Session["RegId"]);
              rptUserStat.DataSource = li.Get_UserStat(li);
              rptUserStat.DataBind();
  
  
          }
      }
  </code></pre>
  
  <hr>
  
  <p>Below is the ASPX code:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptUserStat" runat="server" &gt; 
    &lt;ItemTemplate&gt; 
      &lt;div class="ul_list ul_list-icon-ok"&gt; 
        &lt;ul&gt; 
          &lt;li&gt;
            &lt;i class="icon-question-sign"&gt;&lt;/i&gt;
            &lt;a href="user_questions.html"&gt;Questions&lt;span&gt; ( &lt;span&gt;&lt;%#Eval("") %&gt;&lt;/span&gt; ) &lt;/span&gt;&lt;/a&gt;
          &lt;/li&gt; 
    &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>