Imports System.Data.SqlClient Imports System.IO Imports System.Drawing.Image Imports System.Data Imports System.Web.UI.WebControls.Image Imports System.Web Imports System.Web.UI Public Class _Default Inherits System.Web.UI.Page Public sqlcon As SqlConnection = New SqlConnection("server=.; database=batool; Trusted_Connection=yes;") Public sqlcmd As SqlCommand Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Try Dim picname As String sqlcon.Open() sqlcmd = New SqlCommand("select photo from qq", sqlcon) Dim reader As SqlDataReader = sqlcmd.ExecuteReader If reader.Read Then picname = reader("photo") Image1.ImageUrl = (picname) End If sqlcon.Close() Catch ex As Exception MsgBox(ex.Message) End Try End Sub End Class
picname
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)