Amitesh Verma

Amitesh Verma

  • NA
  • 746
  • 86.9k

pdf using database

Oct 24 2013 1:05 AM
i have about 500 pdf in my website to be displayed....as i am using iframe ,but i ddnt filter the same pdf as i have stored the pdf name iin database....i retrive name from database but couldnt retrive the pdf.//i am posting my code....help///


 string query = "SELECT  distinct(pdfname) FROM feeder where div='" + DropDownList2.Text + "' and grid='" + DropDownList3.Text + "' and feeder='" + DropDownList4.Text + "' ";
        DataTable dt1 = new DataTable();
        dt1 = cs.display(query);
        if (dt1.Rows.Count > 0)
        {
            string pdf1 = dt1.Rows[0]["pdfname"].ToString();
       // Iframe1.Attributes.Add("src", "pdf/"+dt1.Rows[0]["pdfname"].ToString());
            //string szPdfPath = Server.Mappath("D:\\test.pdf"); 
            string pdf2=Server.MapPath("pdf/"+pdf1);
            //Iframe1.Attributes.Add("src", "pdf/" + pdf1);
            Iframe1.Attributes.Add("src",pdf2);
        }

help needed...

Answers (1)