Dear DavidT_macktool and All Forum members,
I know this is not that much simple. But I wrote the following code for the purpose. But i'm getting error msg and can't go further. Can anyone help to solve this code please. Thanks a lot for your help in this regard.
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'
Dim sql AsString = "SELECT picID,Productimage FROM Products WHERE picID = @picID"
'create a connection to the database
Dim con AsNew OleDbConnection(conString)
'create the command
Dim cmd AsNew OleDbCommand(sql, con)
cmd.CommandType = CommandType.Text
'create the parameter
Dim prmID AsNew OleDbParameter
With prmID
.ParameterName = "@picID"
.Value = ListBox1.Items
EndWith
cmd.Parameters.Add(prmID) 'add this to the command
Dim da AsNew OleDbDataAdapter(cmd)
Dim ds AsNew DataSet("Products")
Try
con.Open() 'open the connection
da.Fill(ds) 'fill the dataset
Dim rptCatalogue AsNew CrystalReport1
rptCatalogue.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rptCatalogue
Catch ex As Exception
MessageBox.Show("There is problem Loading Report." & ControlChars.CrLf & ex.Message)
EndTry
EndSub