How to Add Where Clause in RDLC Report In VB Source Code | ProgrammingGeek

preview_player
Показать описание
If you want to add where clause in RDLC report this tutorial is for you. This tutorial teach you how to add where clause in RDLC report in windows form application using VB.Net. The data in RDLC report will be extracted from SQL server database to RDLC report using visual studio code.

This tutorial also covers
- how to add where clause in RDLC report
- how to declare a variable in windows form application using vb

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim sex As String = ""
If RadioButton1.Checked = True Then
sex = "Male"
Else
sex = "Female"
End If
Dim con As New SqlConnection("Data Source=aaaaaaaaaaa129")
Dim com As New SqlCommand("Select * from UserInfo_Tab where Sex ='" & sex & "'", con)
Dim sd As New SqlDataAdapter(com)
Dim dt As New DataTable
sd.Fill(dt)

With Me.ReportViewer1.LocalReport
.DataSources.Clear()
.DataSources.Add(New ReportDataSource("DataSet1", dt))
End With
Me.ReportViewer1.RefreshReport()
End Sub
------
This channel covers all the programming tutorial related with .Net- C#, linq, VB, SQL, Android, HTML, CSS, jQuery, Crystal Report and Microsoft Report.
So, Please subscribe and keep in touch.

Visit my page in Facebook
------
#HowToAddWhereClauseInRDLCReportInVB #WhereClauseInRDLCReportInVB #RDLCReportInC#WithSQL

Рекомендации по теме
Комментарии
Автор

Thanks for such a short and quick solution. I was wondering how about multiple parameters in rdlc? What if non of the value is selected? Logically if there is no parameter selected report should give you all records, right?

syedwaqasahmad
Автор

My toolbox doesn’t have report viewer):
Please help, what should I do?

yunismaruf
join shbcf.ru