byte[] Attachmnt; Attachmnt = (byte[])dataGridView1.Rows[e.RowIndex].Cells["ResumeData"].Value; Document1 objDoc = new Document1(); objDoc.DocContent = Attachmnt; FileStream writeStream; File.WriteAllBytes(Application.StartupPath+Resume, objDoc.DocContent); //Next line is working for .doc extension writeStream = new FileStream(Application.StartupPath + "Raaz.doc", FileMode.Create); //Not Working for .pdf and .xps file writeStream = new FileStream(Application.StartupPath + "File.pdf", FileMode.Create); writeStream = new FileStream(Application.StartupPath + "Fil1.xps", FileMode.Create); //In above two line i want help it should be save in pdf or xps file properly and open //how can we do that user will select his file name with extension through //savefiledialog and then here it should be save as user given BinaryWriter writeBinay = new BinaryWriter(writeStream); writeBinay.Write(objDoc.DocContent); writeBinay.Close(); writeStream.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)