hello can any one help me :)
whats the problem in this 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();
}
}