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=localhost; Integrated
Security=SSPI;" +
"Initial Catalog=invoicing");
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 MyDataAdapterClients = new SqlDataAdapter (strThisQuery,
SQLConn);
MyDataAdapterClients.Fill(DS_MyReportsDS);
MyRpt.SetDataSource (DS_MyReportsDS);
crystalReportViewer1.ReportSource = MyRpt;
I didn't save the report with the data.
Thanks.