使用存储在SQL Server 2008中的文件路径打开Word文档 [英] Opening a word document using a file path stored in SQL Server 2008

查看:213
本文介绍了使用存储在SQL Server 2008中的文件路径打开Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的问题是我需要从保存在数据库(SQL Server 2008)中的路径打开word,excel或pdf文档,而实际文件存储在硬盘驱动器上.
我在asp.net中编码,当我打开文档时,它的格式不正确,带有随机符号.

谁能帮我吗?
在此先感谢

OP更新:
抱歉,我是代码项目的新成员.

我无法将文档存储在应用程序的根文件夹中,也无法将文件路径名存储在SQL中的表中,但是我不知道如何使用保存的文件路径以词的形式打开文档.这是香港专业教育学院试图在按钮单击事件中打开文件的方式.

Hey

My problem is that I need to open a word, excel or pdf document from a path that is saved in my database (SQL Server 2008) and the actual file is stored on the hard drive.

I''m coding in asp.net and when I open the document it''s in an incorrect format with random symbols.

Can anyone please help me?
Thanks in advance

UPDATE from OP:
Sorry im a new member of code project.

Im able to store the document in the root folder of my application and im able to store the file path name in a table in SQL, but i dont know how to get the document to open in word using the saved file path. Here is how ive tried to open the file in a button click event.

推荐答案

使用System.Diagnostics.Process.Start.您将启动Word,并将路径作为启动参数传递.
Use System.Diagnostics.Process.Start. You will start Word and you will pass the path as a startup parameter.


这篇关于使用存储在SQL Server 2008中的文件路径打开Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆