Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Web App Storing Documents in SQL Server

Web App Storing Documents in SQL Server

Scheduled Pinned Locked Moved Web Development
csharpdatabasesql-serversysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike L
    wrote on last edited by
    #1

    Hi, I'm a newbie trying to write a fairly simple web app in C# with two complex issues - I need to present a document dialog box to the user, let them select a (usually MS Word) document on their local drive(s) and store it in a SQL Server 2000 table/column. I'm wondering if someone has some sample code (preferably C#) and can tell me what type of column needs to be defined in SQL Server to hold the document. I'll also need the reverse: pulling the document out (mostly Word documents) and displaying it in the browser window. I'm basically trying to store and retrieve these Word documents from various users in SQL Server 2000. Any help would REALLY be appreciated! Thank you very much in advance! Mike L.

    M 1 Reply Last reply
    0
    • M Mike L

      Hi, I'm a newbie trying to write a fairly simple web app in C# with two complex issues - I need to present a document dialog box to the user, let them select a (usually MS Word) document on their local drive(s) and store it in a SQL Server 2000 table/column. I'm wondering if someone has some sample code (preferably C#) and can tell me what type of column needs to be defined in SQL Server to hold the document. I'll also need the reverse: pulling the document out (mostly Word documents) and displaying it in the browser window. I'm basically trying to store and retrieve these Word documents from various users in SQL Server 2000. Any help would REALLY be appreciated! Thank you very much in advance! Mike L.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi Mike, + To display a dialog box which allows the user to select a document on the client machine and upload it to the server, you can use an input file element. You can find the article posted on CP as an example: http://www.codeproject.com/aspnet/fileupload.asp[^] + To store the Word document in SQL, you can define a column of the image type. + To insert/retrieve the content of the word document, you can use the ADO.NET[^] to implement the functionality. In addition to the above example, you can check out tons of examples in MSDN[^], CP and the internet. + To display the word document in the browser, you can save the content to disk and simply use a link to point to the file. You can also write out the content to the output stream of the Reponse object. Again, the above fileupload article can give you an idea on the issue.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups