try loading the query values in a datasource and a gridview
Dim conn As New MySqlConnection
Dim myCommand As New MySqlCommand
Dim daMySQL As MySqlDataAdapter 'Novo
Dim dsMySQL As DataSet 'Novo
Dim SQL As String
Dim Conectaprovide As New Conectar
Dim oconecta As New Conectar '
oconecta.AbreBanco(conn)
SQL = "SELECT DISTINCT Mensagem " + _
"FROM Home_Mensagem_meio " + _
"ORDER BY Id DESC"
Try
myCommand.Connection = conn
myCommand.CommandText = SQL
Try
daMySQL = New MySqlDataAdapter(SQL, conn)
dsMySQL = New DataSet
daMySQL.Fill(dsMySQL, "mensagem")
gvCategorias.DataSource = dsMySQL
gvCategorias.DataBind()
Catch myerro As MySqlException
End Try
conn.Close()
Catch myerro As MySqlException
Finally
conn.Dispose()
End Try
then you need to recover through the databind the option
<,% # Eval ("link"%)>
<pre lang="xml"><asp:GridView ID="gvCategorias" runat="server" AutoGenerateColumns="False"
Height="123px" Width="146px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="linkCategoria" runat="server"
NavigateUrl='<%#"?id_cat=" + Eval("id")%>'><%# Eval("name") %></asp:HyperLink>
</ItemTemplate>
<HeaderTemplate>
Categorias
</HeaderTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView></pre>