Dim dt As DataTable
Dim objCmd As New SqlCommand
Dim objConn As New SqlConnection
Dim dtAdapter As New SqlDataAdapter
Dim ds As New DataSet
Dim strConnString, strSQL As String
strConnString = "Data Source=PONGWICS2014-PC; Initial Catalog=Top_CustomerEntry;User ID=sa;Password=Pong"
'Str = "SELECT * FROM Employee WHERE id Like '%" & Me.TextBox1.Text & "%' "
strSQL = "SELECT * FROM Employee WHERE ID= '" & Me.password.Text & "' "
objConn.ConnectionString = strConnString
With (objCmd)
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
dtAdapter.SelectCommand = objCmd
dtAdapter.Fill(ds, "Top_CustomerEntryDataSet")
dt = ds.Tables(0)
dtAdapter = Nothing
objConn.Close()
objConn = Nothing
Dim rpt As New ReportDocument()
Dim directory As String = My.Application.Info.DirectoryPath
'rpt.Load(directory & "\myCrystalReport.rpt")
rpt.Load("C:\Users\PongwiCS 2014\Documents\Visual Studio 2010\Projects\WindowsApplication9\WindowsApplication9\CrystalReport1.rpt")
rpt.SetDataSource(dt)
Form2.Show()
End Sub