hi indresh
my database table is storing only the extension of pic (jpg)
and the picture of employee with his emp_no reside on the folder in website called jpg_Pic
example (50.jpg the 50 is no of employee )
this operation did it through this code
if (FileUpload1.HasFile)
{
string FileExtention = Path.GetExtension(FileUpload1.FileName);
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Emp_InfoConnectionString"].ToString());
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = string.Format("Add_Personal_Pic");
cmd.Parameters.AddWithValue("@Name", DropDownList1.SelectedValue);
cmd.Parameters.AddWithValue("@Jpg", FileExtention);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
string filnme = Label5.Text + FileExtention;
string newFileName = Path.Combine(Path.GetDirectoryName(filnme), string.Concat(Path.GetFileNameWithoutExtension(filnme), Path.GetExtension(filnme)));
FileUpload1.SaveAs(Server.MapPath("~/Jpg-Pic/") + newFileName);
}
hope you got my idea any response will appreciated