I am trying to store pdf files in sql server.
I am using an asp.net mvc 2 application with sql server? Can you show me some links to code samples?
I am trying to store pdf files in sql server. I am using an
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer will depend very much on what technology you use to access this SQL Server, whether you are using an ORM, etc… Because you haven’t provided any such information in your question, let me illustrate an example of how to do this using plain ADO.NET.
You could start with a form:
and a controller action to handle the submission of this form:
Of course the SQL part should be externalized into a separate repository to avoid cluttering the controller action with such code. Also if you are using SQL Server 2008 you might take a look at the new FILESTREAM type which is more adapted to this sort of things.