Kieran Brownfield Kieran Brownfield - 5 months ago 9x Question

Visual Basic using Visual Studio 2012 with Access! Can't get image url's to load into picture box

I am currently learning VB and my task is to do a quiz that stores details of the user and also stores the questions and answers. The problem I'm having is that I've stored URL's in the database but I'm unable to turn these into the actual images using the picturebox tool.

Here is my code to do this:

Dim con As New OleDb.OleDbConnection
Dim dbprovider As String
Dim ds As New DataSet
Dim dbsource As String
Dim sql As String
Dim da As OleDb.OleDbDataAdapter

dbprovider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
dbsource = "Data Source = C:\Users\kiera\Desktop\Assignment2.mdb"

con.ConnectionString = dbprovider & dbsource

sql = "Select * from questions_new Where ID = 1"
da = New OleDb.OleDbDataAdapter(sql, con)
da.Fill(ds, "Question")

For Each row As DataRow In ds.Tables("Question").Rows
Label1.Text = (row.Item("Question"))
Label2.Text = (row.Item("Answer_1"))
Label3.Text = (row.Item("Answer_2"))
Label4.Text = (row.Item("Answer_3"))
Label5.Text = (row.Item("Answer_4"))
PictureBox1.Image = (row.Item("Img"))

Next row

' con.Close()
End Sub


The issue is that PictureBox1.Image has a type of System.Drawing.Image.

The property that you want is PictureBox1.ImageLocation which is a string that can be a local path or a URL.