Private Sub bt_rpt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_rpt.Click
Dim strSQL As String = " SELECT inv.inv_id AS Expr1, member.*, item.*FROM ((inv INNER JOIN member ON inv.mem_id = member.mem_id) INNER JOIN item ON inv.inv_id = item.inv_id)WHERE(inv.inv_id = '" & rpt_txt.Text & "') "
'Dim strSQL As String = " select inv.*, member.*, item.* from inv,member,item where inv.mem_id = member.mem_id and inv.inv_id = item.inv_id adn inv.inv_id = '" & rpt_txt.Text & "'"
Dim cm As New OleDbCommand(strSQL, conn)
Dim dt As DataTable
conn.ConnectionString = strConnection
With cmd
.Connection = conn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
da.SelectCommand = cmd
da.Fill(ds, "DataTable1")
dt = ds.Tables(1)
da = Nothing
conn.Close()
conn = Nothing
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim directory As String = My.Application.Info.DirectoryPath
rpt.Load("C:\Users\kwan\Documents\Visual Studio 2008\Projects\test\app1\CrystalReport5.rpt")
rpt.SetDataSource(dt)
Me.CrystalReportViewer1.ReportSource = rpt
Me.CrystalReportViewer1.Refresh()
End Sub
End Class