Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet
Dim da As SqlDataAdapter
Dim SQLquery As String = ""
Dim CurrentReport As New PT1()
SQLquery = "select * from PT1 where LANDID='" & frm_land.txtLANDID.Text & "'"
With Conn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = strConn
.Open()
End With
da = New SqlDataAdapter(SQLquery, Conn)
da.Fill(ds, "PT1")
CurrentReport.SetDataSource(ds.Tables("PT1"))
CrystalReportViewer1.ReportSource = CurrentReport
CrystalReportViewer1.Show()
CrystalReportViewer1.Refresh()
End Sub
End Class
Tag : .NET, Ms SQL Server 2008, Crystal Report, Win (Windows App), VB.NET, VS 2010 (.NET 4.x)