I' m new in this, also I'm new in Visual Basic and Sql Server, and I'm Chile... Well, I have a question, I've been thinking for several days and can not solve. I need to show an image in a web form of a client when he wants to see your information.
For that, I have the next sources:
Table Client
email(varchar), nameClient(varchar), nameImage(varchar)
Table Image
nameImage(varchar), image(image)
I have the next proc:
select c.email, c.nameClient, i.image
from Client as c join Image as i on c.nameImage=i.nameImage
In asp.net, I have a web Form as VerCliente.aspx, and in VerCliente.aspx.vb I have this:
Partial Class Default19
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
MostrarNombreCliente.Text = Session("correo")
End Sub
Protected Sub BotonMostrarPerfil_Click(sender As Object, e As EventArgs) Handles BotonMostrarPerfil.Click
Dim numero As Integer
Dim dvSql As Data.DataView = DirectCast(SqlDataSource1.Select(DataSourceSelectArguments.Empty), Data.DataView)
'of this way I do the connection to BD'
If dvSql.Count > 0 Then
numero = 1
'to display the information in the textbox Iam occupying session variables'
Session("email") = dvSql(0).Item(0)
MostrarEmail.Text = Session("email")
Session("nombre") = dvSql(0).Item(1)
MostrarNombreCompleto.Text = Session("nombre")
in VerCliente.aspx I have this , and I would display the image on it
asp:Image ID="MostrarImagen" runat="server" Height="191px" Width="270px" /
but I dont know how to occupy session variables here
MostrarImagen.ImageUrl....(I dont know How )
I tried this but it does not work
Session("imagen") = dvSql(0).Item(2)
MostrarImagen.ImageUrl.ImageUrl = Session("imagen")
End If
End Sub
End Class
thank....bye!!!