Click here to Skip to main content
12,502,009 members (47,400 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
please help me about how to upload/download doc,pdf files to SqlServer database r2 through
Windows form application in C# language.
Posted 26-Feb-13 0:32am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Uploading the file and saving it in your database:
You can use the following code c#

private void pdfuploadBtn_Click(object sender, EventArgs e)
        {
            OpenFileDialog Openpdf = new OpenFileDialog();
            Openpdf.Filter = "PDF files|*.pdf|All files|*.*;";
            if (Openpdf.ShowDialog() == DialogResult.OK)
            {
                string pdfLog = Openpdf.FileName.ToString();
                pdfUploadbox.Text = pdfLog;
                axAcroPDF1.src = Openpdf.FileName;
                //pdfUploadbox.Text = pdfLog;
            }
            if (axAcroPDF1.src == null)
            {
                MessageBox.Show("Try new file");
            }
            else { MessageBox.Show("PDF Uploaded"); }
 
        }
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 7 Jun 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100