locked
SQL PDF to Adobe Control from GridView RRS feed

  • Question

  • Hi All

    I have to be able to load a PDF (stored in SQL as image) via a Stored Procedure. The stored procedure selects the ID, PDF Field and PDF Name. I  can view this in a gridview filtered by the ID. When i click the view link the following code is run:

    The PDF is is stored in SQL as a image type.

    I have a  axAcroPDF1  Adobe Reader Control which i want to display the PDF when view Link on the Gridview is clicked on.

    Thank you in advance.

     private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
            {

      var code = OrderNumber.Text;
                string connectionString = ConfigurationManager.ConnectionStrings["  "].ConnectionString;
                using (var conn = new SqlConnection(connectionString))
                using (SqlCommand cmd = new SqlCommand("[dbo].[Stored_Proc_Load]", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@OrderNumber", code));
                    conn.Open();
                    cmd.ExecuteNonQuery();
                    SqlDataReader result = cmd.ExecuteReader();
                    result.Read();
                    if (result.HasRows)
                    {
                      
                     // what code do i put here?

                   }
                    conn.Close();



    • Edited by shabbs Thursday, December 11, 2014 3:35 PM
    • Moved by Carl Cai Thursday, December 18, 2014 6:19 AM mainly related to third-party
    Thursday, December 11, 2014 3:30 PM

Answers

  • Since this issue is mainly related to Adobe, I prefer posing this issue in its forum to get support.


    remember make the reply as answer and vote the reply as helpful if it helps.

    • Proposed as answer by Carl Cai Thursday, December 18, 2014 6:13 AM
    • Marked as answer by Just Karl Wednesday, December 31, 2014 11:30 PM
    Friday, December 12, 2014 10:58 AM