how to add upload control in gridview in asp.net
<p>how to add file upload control in item template in grid view.unable to get file name from upload control of gridview.how to add file upload control in gridview for every row</p>

<pre><code>&lt;asp:GridView runat="server" ID="gridviewAddPo" AutoGenerateEditButton="false" OnRowEditing="gridviewAddPo_RowEditing" OnRowUpdating="gridviewAddPo_RowUpdating" AutoGenerateColumns="false"&gt;
  &lt;Columns&gt;  
        &lt;asp:TemplateField&gt;  
            &lt;ItemTemplate&gt;  
                &lt;asp:Button ID="btn_Edit" runat="server" Text="Edit" CommandName="Edit" /&gt;  
            &lt;/ItemTemplate&gt;  
            &lt;EditItemTemplate&gt;  
                &lt;asp:Button ID="btn_Update" runat="server" Text="Update" CommandName="Update"/&gt;  
                &lt;asp:Button ID="btn_Cancel" runat="server" Text="Cancel" CommandName="Cancel"/&gt;  
            &lt;/EditItemTemplate&gt;  
        &lt;/asp:TemplateField&gt;  


      &lt;asp:TemplateField&gt;
          &lt;ItemTemplate&gt;
            &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt;
            &lt;asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Upload" /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:TemplateField&gt;
      &lt;asp:TemplateField HeaderText="ID"&gt;  
                        &lt;ItemTemplate&gt;  
                            &lt;asp:Label ID="lbl_ID" runat="server" Text='&lt;%#Eval("id") %&gt;'&gt;&lt;/asp:Label&gt;  
                        &lt;/ItemTemplate&gt;  
      &lt;/asp:TemplateField&gt;  
    &lt;Columns/&gt;
&lt;/asp:Gridview&gt;
</code></pre>

<p>Code behind is this:</p>

<pre><code>protected void Upload(object sender, EventArgs e)
{
    string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);//getting errrorhow ot 
    string contentType = FileUpload1.PostedFile.ContentType;
    using (Stream fs = FileUpload1.PostedFile.InputStream)
    {
        using (System.IO.BinaryReader br = new BinaryReader(fs))
        {
            byte[] bytes = br.ReadBytes((Int32)fs.Length);
            string constr = ConfigurationManager.ConnectionStrings["kernelCS"].ConnectionString;
            using (SqlConnection con = new SqlConnection(constr))
.....
}
</code></pre>