开发者

What are the Steps to Upload a Document File from Windows Application to SQL Server DB?

Here are my steps:

  1. Created the controls manually by dragging a textbox then a button besides it which i think its not the right way to do it. Example:

What are the Steps to Upload a Document File from Windows Application to SQL Server DB?

Any idea which control should i use?

2.The column's datatype (in sql-server) is varbinary(MAX) which will hold the document file. Is this the correct datatype for holding documents?

3.In my application, i will have a temporary variable which holds the uploaded/picked document which then i pass the doc开发者_如何学Pythonument to the db. What datatype should i use for this temporary variable (which will hold a document file of type .pdf).

I'm using c# Windows Application.

Thanks


Unless you have a compelling reason for storing documents directly in the database, I would re-think your strategy. Yes it can be done, but it is not always the best way to proceed. In my opinion, it is usually better to store the documents/images in the file system/folders, and then store only the meta-data about the file in the database.

You might have very good reasons why you want to do this, but make sure the reasons are sound. There are some benefits, but a lot of drawbacks as well.


  1. Use the FileUpload control.

  2. yes

  3. byte[] or stream

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜