Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me about how to upload/download doc,pdf files to SqlServer database r2 through
Windows form application in C# language.
Posted

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

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"); }

        }
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900