Report not accepting the condition
I have createc view for two tables and I am trying to get report according to a condition(search by schoolid). The problem is, in the second query (denoted with '*****) is not retrieving the records accroding to the condition. It's simply retriecving all the record. Can anyone help me. Throug the query , in my xml file, I am geting the exact result. And I have tried to print Response.Write(Ds.Tables(0).Rows.Count), it's retrieving the exact number of rows, but the report viewer is displying wrong result.
crpt = New Admini
Dim cmd As New SqlCommand
Dim Da As New SqlDataAdapter
Dim Ds As New DataSet
Dim SchoolID As String
Dim ClassID As String
SchoolID = "Ab1"
ClassID = "1-A"
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = "IB"
myLogin.ConnectionInfo.DatabaseName = "FS"
myLogin.ConnectionInfo.Password = "1"
myLogin.ConnectionInfo.UserID = "sa"
' **********get the result from view....>This is not checking the condition******************
SchoolID = "Ab0"
Dim Con As SqlConnection
Con = New SqlConnection("server=IB; uid=sa; pwd=1; database=FS")
Da = New SqlDataAdapter("Select * From vAdminDetailRpt where SchoolID= '" & SchoolID & "'", Con)
Me.CrystalReportViewer1.Visible = True
CrystalReportViewer1.EnableDrillDown = False
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ReportSource = crpt