Word Doc from Database
-
Word Doc from Database Hi i am creating an application that help the user to upload his word documents to an sql server database i want to bind a datagrid to the database so the user can see what he uploaded. also, when the user clicks on the document title it will load it in Microsoft Word so he can read it. any idea how to bind the datagrid to the documents stored in the databse and how to load a document into Microsoft word? Nina
-
Word Doc from Database Hi i am creating an application that help the user to upload his word documents to an sql server database i want to bind a datagrid to the database so the user can see what he uploaded. also, when the user clicks on the document title it will load it in Microsoft Word so he can read it. any idea how to bind the datagrid to the documents stored in the databse and how to load a document into Microsoft word? Nina
Hi, I appologise for my knowledge of English. I think you be able use table in data base - Name(char(50)), Data(text). Name for document title and Data for Ms Word document. For load document you be able use ASP.NET web handler's. Web handlers are software modules that handle raw HTTP requests received by ASP.NET. I be able send you sample use this handler's.
-
Word Doc from Database Hi i am creating an application that help the user to upload his word documents to an sql server database i want to bind a datagrid to the database so the user can see what he uploaded. also, when the user clicks on the document title it will load it in Microsoft Word so he can read it. any idea how to bind the datagrid to the documents stored in the databse and how to load a document into Microsoft word? Nina
Hi, This is very simple. 1) You store the word document in a specific folder on the server. 2) Store the filename and path details to a database table. 3) Select the files information and assign to a datagrid, on the datagrid make the file name as a hyperlink. 4) onclick of the link open the file by changing the content type. Ram
-
Hi, This is very simple. 1) You store the word document in a specific folder on the server. 2) Store the filename and path details to a database table. 3) Select the files information and assign to a datagrid, on the datagrid make the file name as a hyperlink. 4) onclick of the link open the file by changing the content type. Ram
can you show me a code sample of changing the content type?? and downloading the file?
-
can you show me a code sample of changing the content type?? and downloading the file?
Onclick event of an linkbuttton (which has file name as text) write this code(change variable names etc...) sFullFilePath is the file path (Retrieved from database table) System.IO.FileInfo oFileInfo = new System.IO.FileInfo(sFullFilePath); if(oFileInfo.Exists) { Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + sOrigFilename); Response.AddHeader("Content-Length", oFileInfo.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(sFullFilePath); Response.End(); } else { lblMessage.Text = "The file cannot be found."; } Ram