1 Replies - 10688 Views - Last Post: 05 December 2007 - 06:25 PM Rate Topic: -----

#1 dpksngl  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-November 07

how to store file in sql server through vb.net

Posted 05 December 2007 - 04:38 AM

hey i want to insert pdf into sql server database thruogh vb.net

how can i do that
Is This A Good Question/Topic? 0
  • +

Replies To: how to store file in sql server through vb.net

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: how to store file in sql server through vb.net

Posted 05 December 2007 - 06:25 PM

Well, coming from the "Efficient Programing" background I come from Id say that is a bad, bad idea. Storing actual documents, especially of special format like a PDF is a performance issue waiting to bit you in the a**.

What you want to do is store the document in a folder on the users computer, usually the

GetFolderPath(SpecialFolder.ApplicationData) & _
"\" & Application.ProductName & "\" & sFileName



That puts it in the C:\Documents and Settings\<UserName>\Application Data\<Application Name>\,FOle Name>, then in the database store the name of the document, the path (if you chose to) and the display name you wish to use. Storing entire PDF's is a performance issue though.
Was This Post Helpful? 1

Page 1 of 1