none
fill report1.rdlc with select command and where condation RRS feed

  • Question

  • i try to fill report1.rdlc with below code but it show empty

    Imports Microsoft.Reporting.WinForms
    Public Class report1

    End Class
    Public Class Form3

        Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'TODO: This line of code loads data into the 'MasterDataSet.MPatient1' table. You can move, or remove it, as needed.

            Me.ReportViewer1.RefreshReport()
            Dim rpt As New report1
            Dim rptDataSource As ReportDataSource
            dt.Clear()
            If form1.TextBox3.Text <> "" Then
                Cmd.CommandText = "Select * from  [mpatient] where LabNo ='" & form1.TextBox3.Text & "'"
                OpenConnect()
                da.SelectCommand = Cmd
                da.Fill(ds, "mpatient1")
                rptDataSource = New ReportDataSource("masterdataset", ds.Tables("mpatient1"))
                Me.ReportViewer1.LocalReport.DataSources.Add(rptDataSource)
            End If

        End Sub
    End Class

         
    Sunday, March 16, 2014 6:13 AM