1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Image1.Visible = True
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= C:\Inetpub\wwwroot\test.mdb;"
strSql = "select Path from Images where Image = '" & ListBox1.SelectedValue & "'"
ObjetConnection = New OleDbConnection
ObjetConnection.ConnectionString = strConn
ObjetConnection.Open()
ObjetCommand = New OleDbCommand(strSql)
ObjetDataAdapter = New OleDbDataAdapter(ObjetCommand)
ObjetCommand.Connection() = ObjetConnection
ObjetDataAdapter.Fill(ObjetDataSet, 0)
ObjetDataTable = ObjetDataSet.Tables(0)
Label1.Text = ListBox1.SelectedIndex
Image1.ImageUrl = ObjetDataSet.Tables(0).Rows(0).Item(0)
End Sub |
Partager