Posted on: 7/8/2014 10:34:43 AM | Views : 413

I am creating Pdf file from dataset for first time i can create pdf but for the secnd time its giving me this error 

here is my code 

for first tim its going to rendercontrol and for the secnd time its giving me this error 

public void Email() { try { emaildata(); string userMail = emailname + "@ksmc.med.sa"; using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter hw = new HtmlTextWriter(sw)) { DetailsView1.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); using (MemoryStream memoryStream = new MemoryStream()) ...

Go to the complete details ...