hi I am new in programming and I hope all with respect to help me I create a form with vb.net EX: "main Branches " and I want to print current data record so I create another form and put RDCL report in it and it is run well but showing all record. i want the report show only the current record
note:-
if i remove where condition the report show all data and if i use where condition it does not show any record
' the form which contain the record ' Private Sub BTN_PRINT_Click(sender As Object, e As EventArgs) Handles BTN_PRINT.Click
Dim f As New Form1 f.ShowDialog() End Sub ''the form which contain rdcl report '' Private Sub ReportViewer1_Load(sender As Object, e As EventArgs) Handles ReportViewer1.Load Dim codee As String = FRM_BR.TXT_code.Text Dim CON As New SqlConnection("Data Source=MOHAMEDTHRWAT20\SQLEXPRESS;Initial Catalog=data_egy;User ID=sa") Dim COM As New SqlCommand("SELECT * FROM [dbo].[tb_br] where code ='" & codee & "' ", CON) Dim SD As New SqlDataAdapter(COM) Dim DTa As New DataTable SD.Fill(DTa) With Me.ReportViewer1.LocalReport .DataSources.Clear() .ReportPath = "C:\Users\mothr\onedrive\المستندات\visual studio 2012\Projects\WindowsApplication1\WindowsApplication1\PL\PL_ACC\Report1.rdlc" .DataSources.Add(New ReportDataSource("DataSet1", DTa)) End With Me.ReportViewer1.RefreshReport() End Sub