开发者

How to open a binary file directly from a database in c#?

Hey there, i have a table with a field called "file" full of binary data (The File Itself) how can i open this binary data directly from the database on a click Event for exa开发者_StackOverflowmple using c# ?

i dont want to download the file each time to view it .. just view it using the default viewer in the user's OS.

Any Ideas ??


To start off with other than an extremely trivial (throwaway) application I hope that you have setup some layers to abstract the DB access from your UI.

Ultimately your application will have to get the binary object from the DB table and present it as a file to the OS. The applications that come to mind typically want you to pass a filename to them to open them. In essence this means you have to download the file to the local machine with this technique.

The alternative would be to store the files on the filesystem of a server somewhere and place the name/location in your DB (nvarchar). Your application could get the filename/location and pass that to the viewer application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜