In Html Page
<table width="100%">
<tr>
<td align="right">
</td>
</tr>
<tr>
<td>
<iframe id="ipdfviewer" width="100%" height="400px" runat="server"></iframe>
</td>
</tr>
</table>
In Cs Page
void ShowPdf()
{
Con.Open();
string Qry = "Select * from TblLabTempReport";
SqlCommand Cmd = new SqlCommand(Qry, Con);
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(Cmd);
da.Fill(ds);
string FileName;
byte[] byteArray;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
string LocationPath = "PdfContent/";
string WriteFilePath = Server.MapPath("~/PdfContent/");
byteArray = (byte[])ds.Tables[0].Rows[0]["PdfBinary"];
FileName = "Sample.pdf";
LocationPath = LocationPath + FileName;
WriteFilePath = WriteFilePath + FileName;
if (!File.Exists(WriteFilePath))
{
System.IO.File.WriteAllBytes(WriteFilePath, byteArray);
}
ipdfviewer.Attributes.Add("src", LocationPath);
}
Con.Close();
}