Object reference not set to an instance of an object
<p>hello 
 can any one help me :)</p>

<p>whats the problem in this code ?? </p>

<pre><code>protected void LinkButton1_Click(object sender, EventArgs e)
{
    //object o = new object();
    //Control co = new Control();
    //co = GridView1.FindControl("EmpFileUpload");
    FileUpload f = new FileUpload();
    (System.Web.UI.WebControls.FileUpload)f = (System.Web.UI.WebControls.FileUpload)(GridView1.FindControl("EmpFileUpload"));

    if (f.HasFile)
    {
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["schoolsConnectionString"].ConnectionString);
        conn.Open();
        SqlCommand insertCommand = new SqlCommand("insert_Empimg", conn);

        insertCommand.Parameters.Add("Emp_imgPath", SqlDbType.NVarChar, 0).Value =f.FileName;

        insertCommand.CommandType = CommandType.StoredProcedure;
        insertCommand.ExecuteNonQuery();

        conn.Close();
    }



}
</code></pre>
