In my Windows form, I have a discrepancy between what the CrystaReport
viewer displays and what the dataset contains. The Report displays data
from three fields from same table but the reportviewer displays all the data
in the table regardless of the select I run (in this case, the select
returns only one record):
test MyRpt = new test();
DataSet DS_MyReportsDS = new DataSet();
SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t; Integrated
Security=SSPI;" +
"Initial Catalog=invoici ng");
string strThisQuery = "select clientid,fname, lname1 from clientdata where
clientid = '00001' "; //I should only get one record but the viewer
displays all of them
SqlDataAdapter MyDataAdapterCl ients = new SqlDataAdapter (strThisQuery,
SQLConn);
MyDataAdapterCl ients.Fill(DS_M yReportsDS);
MyRpt.SetDataSo urce (DS_MyReportsDS );
crystalReportVi ewer1.ReportSou rce = MyRpt;
I didn't save the report with the data.
Thanks.
viewer displays and what the dataset contains. The Report displays data
from three fields from same table but the reportviewer displays all the data
in the table regardless of the select I run (in this case, the select
returns only one record):
test MyRpt = new test();
DataSet DS_MyReportsDS = new DataSet();
SqlConnection SQLConn = new SqlConnection(" Data Source=localhos t; Integrated
Security=SSPI;" +
"Initial Catalog=invoici ng");
string strThisQuery = "select clientid,fname, lname1 from clientdata where
clientid = '00001' "; //I should only get one record but the viewer
displays all of them
SqlDataAdapter MyDataAdapterCl ients = new SqlDataAdapter (strThisQuery,
SQLConn);
MyDataAdapterCl ients.Fill(DS_M yReportsDS);
MyRpt.SetDataSo urce (DS_MyReportsDS );
crystalReportVi ewer1.ReportSou rce = MyRpt;
I didn't save the report with the data.
Thanks.
Comment