Hy, i have a problem with populating crystal report. I'm using DataTable and fill it and then pass data to crystal reports. In my DataTable i have all data from my select query, but in crystal report i have all data from database!
The problem should be the data in your datatable. The result you got may occur when you get the database data from guide rather than dynamic code from your select query. I don't know which database are you using?
Code Snippet populating crystal report from select query with C# and SQL Server database:
private void populateCrystalReport()
string connectionString = "Server=.;Database=xx; User ID=sa;Password=xx";
myConnection = new SqlConnection(connectionString);
string sqlString = "SELECT A, B, C FROM myTable WHERE A='a'";
mySQLCommand = new SqlCommand(sqlString, myConnection);
mySQLDataAdapter = new SqlDataAdapter(sqlString, myConnection);