i want to show pdf file ,first i convert the pdf file to binary then i saved in database ,now i want to convert binary to pdf file .
my code is given below
SqlConnection con =new SqlConnection(ObjDb.consrtring);
con.Open();
SqlCommand cm=con.CreateCommand();
//string Query = ObjDb.GetDataField("Select DocImage from tblPdoc where ID=" + picID, "DocImage");
cm.CommandText="Select DocImage from tblPdoc where ID=" + picID;
//cm = new SqlCommand(Query, con);
// cm.CommandText = Query;
// string qq = Query;
byte[] binaryData = (byte[])cm.ExecuteScalar();
File.WriteAllBytes(".pdf",binaryData);
string s =Encoding.UTF8.GetString(binaryData);
this.axAcroPDF1.LoadFile(s);
con.Close();
return s;
after encoding the file is showing in this formate and pdf file is not showing
UDb��@�\~�� �R�&������V�wF�b"�f��FW"�f�FTFV6�FS��7G&VЧ��Qƺ��U L P���v���t��ZW�5ڑ�'�([b$�O���ύ�����ǽ�R�֮K��7��c�}��RMUn��^<�u���������Cy��ߖ�2h��1����}���
«;�Ƣ:a�1Ic�]k����r烙�����������N��Y%3En��4���֬Z��}I7
��%��vA��6��U�]�Ժ;���}%%L�}���%����:�RB�b/���\@M���1i���/?�f�����:;�ź�L�N���w�/|�}Mha�m&�/eػ�&Tz�a�Yi7U��VFp����
kindly tell me what should i do?