how to create image gallery using datalist control with an upload file and database?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Apr 9, 2014, 3:22 AM
go to this link and this link
Height="100px" onclick="LoadDiv(this.src, this)" Style="cursor: pointer" />
Create a new Page GetImage.aspx ..In page load write
Dim NewSQLConnection As New OleDbConnection
NewSQLConnection.ConnectionString = ConfigurationManager.ConnectionStrings("MySqlServConnection").ToString
Dim id as String = Request.QueryString["id"];
Dim SqlQuery As String = "SELECT ImageUrl FROM tblPhotoBlob WHERE photoid ='" & id & "'"
Try
NewSQLConnection.Open()
Catch ex As Exception
Throw ex
End Try
Dim SQLCommand As New OleDbCommand(SqlQuery, NewSQLConnection)
Dim SQL_DataAdapter As New OleDbDataAdapter(SQLCommand)
Dim SQL_DataTable As New DataTable()
SQL_DataAdapter.Fill(SQL_DataTable)
Dim dataTableRowCount As Integer = SQL_DataTable.Rows.Count
If dataTableRowCount > 0 Then
DataList1.DataSource = SQL_DataTable.Rows(0)["ImageUrl"]
DataList1.DataBind()
Else
DataList1.DataBind()
End If