how to create image gallery using datalist control with an upload file and database?
How to create image gallery using datalist?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 8, 2014, 11:22 PM EDT
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