Dim Conn As New OleDbConnection
Dim StrConn As String="Connection String"
With Conn
.ConnectionString=StrConn
.Open
End With
Dim DA As New OleDbDataAdapter
Dim DS As New DataSet
Dim SQL As String="SELECT * FROM tbInvoices WHERE InvNo=" & Val(txtInvoice.text)
DA=New OleDbDataAdapter(SQL,Conn)
DA.Fill(DS,"tbInvoices")
Dim rpt As New ReportDocument()
If DS.Tables(0).Rows.Count <> 0 Then
rpt.Load("CrystalReport1.rpt")
rpt.SetDataSource(DS)
CrystalReportViewer1.ReportSource = rpt
End If