Pleeeease help
I want to display an image in (Main.aspx) which contains the following tag:
<asp:Image id="img1" ImageUrl="DisplayImage.aspx?id=1007" Runat="server"/>
And I write the following Page_Load Sub for DisplayImage.aspx:
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
Dim SelectedID As String = Request.QueryString("id")
Dim ConnStr As String = "user id=sa;data source=Server\Instance1;initial catalog=MYDB"
Dim Conn As New SqlClient.SqlConnection(ConnStr)
Dim MyCommand As New SqlClient.SqlCommand("Select * from Students where id = " + SelectedID, Conn)
Dim SQLReader1 As SqlClient.SqlDataReader
Conn.Open()
SQLReader1 = MyComm.ExecuteReader(CommandBehavior.CloseConnecti on)
Response.BinaryWrite(SQLReader1.Item("Picture"))
Conn.Close()
End Sub
Where the SQLReader1.item("Picture") returns image value from SQL Server Table (Students)
The Problem is:
when I debug the execution of the page load, all statements(which follow the first access to the database) are not executed.
Here,for example, All statements after (SQLReader1 = MyComm.ExecuteReader) are not executed
