title: How to populate drop down list selected for search record using stored procedure
body: <p>I am newbie on asp.net c#. How to show record when drop down list selected by user using stored procedure with C# code. Can anyone give me some example of this? Thank you</p>
  
  <p>Below my code :</p>
  
  <pre><code>&lt;div id="divStatus"&gt;
  &lt;center style="height: 489px; width: 768px"&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;asp:Label ID="lblHead" runat="server" Text="Call Status Report" 
          style="font-weight: 700"&gt;&lt;/asp:Label&gt;
      &lt;br /&gt;
  &lt;br /&gt; 
  &lt;table style="width: 250px"&gt;
  &lt;tr&gt;
  &lt;td&gt;Select Employee&lt;/td&gt;
  &lt;td&gt;&lt;asp:DropDownList ID="ddlEmp" runat="server"&gt;&lt;/asp:DropDownList&gt;&lt;/td&gt;
  &lt;td&gt;&lt;asp:RequiredFieldValidator ID="rfvEmp" runat="server" ControlToValidate="ddlEmp" ErrorMessage="*"  &gt;&lt;/asp:RequiredFieldValidator&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td  colspan="2"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td style="margin-left: 40px"&gt;
      &lt;asp:Button ID="btnStatus" runat="server" 
          Text="Status" Width="71px" onclick="btnStatus_Click" /&gt;
          &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;asp:GridView ID="gvStatus" runat="server" AllowPaging="True" 
          AutoGenerateColumns="False" 
          onpageindexchanging="gvStatus_PageIndexChanging" Width="464px"&gt;
  &lt;Columns&gt;
  &lt;asp:BoundField DataField="Call_logID" HeaderText="Log ID" /&gt;
                  &lt;asp:BoundField DataField="EntryTime" HeaderText="DateIn" /&gt;
  &lt;asp:BoundField DataField="Log_Status" HeaderText="Status" /&gt;
  &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>below its my Store procedure:</p>
  
  <pre><code>@Log_EntryBy varchar(100) = ''
  AS
  
  select CONVERT (varchar(50),EntryTime,103)as Date, Call_logID,Log_code , Log_Status from Call_Log_Service
  where Log_EntryBy = @Log_EntryBy order by Call_logID
  </code></pre>