我正在从事一个项目,虽然我不是一个编程学生,所以不太了解它
我已在我的数据库中保存图像和链接
但我想在我的应用程序中集体检索所有这些(如一个图像及其相关网站的链接),以便用户可以查看图像,如果他想要访问与图像相关的网站,他可以点击链接或按钮(但图像和链接同时恢复)
或根据检索到的图像是否有任何方式按钮自动生成???
“我发布这个只是becoz强制发布您尝试的内容”所以从某处复制
Dim conn As New MySqlConnection
conn.ConnectionString = ConnectionString
Dim cmd As New MySqlCommand
cmd.Connection = conn
conn.Open()
cmd.CommandText = "SELECT Foto FROM MyTable WHERE ID = '" & IDtxt.ToString & "'"
Dim reader As MySqlDataReader
reader = cmd.ExecuteReader
While reader.Read
If (IsDBNull(reader("Foto"))) Then
frmCartaIdentitaView.pctImage.Image = Nothing
Else
Dim byteImage() As Byte = reader("Foto")
Dim frmImageView stmFoto As New System.IO.MemoryStream(byteImage)
frmImageView.pctImage.Image = Image.FromStream(stmFoto)
frmImageView.pctImage.SizeMode = PictureBoxSizeMode.Zoom
frmImageView.Show()
End If
End While