S
shabbs
Guest
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();
Continue reading...
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();
Continue reading...