Like you Know the easier way to fill a dataset is with a dataAdapter like this :
DataSetEmp myDataSet = new DataSetEmp();
…(here Id did a select request..)
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = myCommand1;
adapter.Fill(myDataSet.myDataTable1);
AND
……(here Id did a select request..)
SqlDataAdapter adapter2 = new SqlDataAdapter();
adapter2.SelectCommand = myCommand2;
adapter2.Fill(myDataSet.myDataTable2);
//I have a Crystal report
CrystalReport1 report1 = new CrystalReport1();
report1.setDataSource(myDataSet);
This Way works perfectly good, but I want to fill data with DataReader not DataAdapter because I want to Check some values In a while(myReader.read()){ ….} loops.
You have to populate the
DataTablemanually using its methods and properties. Eg. creating each containedDataTablein turn (in essence re-creating the implementation ofDataAdapter.Fill).Alternately you could use the
DataAdapterand before passing it to Crystal Reports use those same members to modify theDataTable‘s content.